From 1b194f252557051d4c625b596f2b7928a6cc01db Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Wed, 21 Jan 2015 09:22:27 -0500 Subject: 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. --- lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.cpp') 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(){ -- cgit