diff options
author | Ken Moore <ken@pcbsd.org> | 2015-01-21 09:22:27 -0500 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2015-01-21 09:22:27 -0500 |
commit | 1b194f252557051d4c625b596f2b7928a6cc01db (patch) | |
tree | c815dff4af1ee69a9b4ee1b469aa0ad2313c2aa3 /lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp | |
parent | Completely revamp the notepad desktop plugin so that it is now file-based ins... (diff) | |
download | lumina-1b194f252557051d4c625b596f2b7928a6cc01db.tar.gz lumina-1b194f252557051d4c625b596f2b7928a6cc01db.tar.bz2 lumina-1b194f252557051d4c625b596f2b7928a6cc01db.zip |
Add a new panel-plugin: appmenu
This plugin re-creates the classic "start" menu from other OS's.
Also update how panel-plugins open menus, so now the menu will no longer cover the button that opened it.
Diffstat (limited to 'lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp')
-rw-r--r-- | lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp b/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp index 4e5b3139..8f663b0f 100644 --- a/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp +++ b/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp @@ -13,7 +13,7 @@ LSysDashboard::LSysDashboard(QWidget *parent, QString id, bool horizontal) : LPP button = new QToolButton(this); button->setAutoRaise(true); button->setToolButtonStyle(Qt::ToolButtonIconOnly); - button->setToolTip(QString("System Dashboard")); + button->setPopupMode(QToolButton::DelayedPopup); //make sure it runs the update routine first connect(button, SIGNAL(clicked()), this, SLOT(openMenu())); this->layout()->setContentsMargins(0,0,0,0); this->layout()->addWidget(button); @@ -24,6 +24,7 @@ LSysDashboard::LSysDashboard(QWidget *parent, QString id, bool horizontal) : LPP mact->setDefaultWidget(sysmenu); menu->addAction(mact); + button->setMenu(menu); QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes } @@ -38,6 +39,7 @@ void LSysDashboard::updateIcon(bool force){ //For the visual, show battery state only if important static bool batcharging = false; QPixmap pix; + button->setToolTip(tr("System Dashboard")); if(LOS::hasBattery()){ int bat = LOS::batteryCharge(); bool charging = LOS::batteryIsCharging(); @@ -79,7 +81,7 @@ void LSysDashboard::resetIcon(){ void LSysDashboard::openMenu(){ sysmenu->UpdateMenu(); - menu->popup(this->mapToGlobal(QPoint(0,0))); + button->showMenu(); } void LSysDashboard::closeMenu(){ |