diff options
-rw-r--r-- | lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp | 9 | ||||
-rw-r--r-- | lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp index 95c52d9a..433441dd 100644 --- a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp +++ b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp @@ -12,11 +12,12 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal) this->setStyleSheet( "QToolButton::menu-indicator{ image: none; } QToolButton{padding: 0px;}"); //Setup the widget label = new QToolButton(this); - label->setPopupMode(QToolButton::InstantPopup); + label->setPopupMode(QToolButton::DelayedPopup); label->setAutoRaise(true); label->setToolButtonStyle(Qt::ToolButtonIconOnly); label->setIcon( LXDG::findIcon("preferences-desktop-display-color", "") ); label->setToolTip(QString("Workspace 1")); + connect(label, SIGNAL(clicked()), this, SLOT(openMenu())); menu = new QMenu(this); connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuActionTriggered(QAction*))); connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); @@ -109,6 +110,12 @@ int LDesktopSwitcher::getCurrentDesktop() { return number; } */ +void LDesktopSwitcher::openMenu(){ + //Make sure the menu is refreshed right before it opens + createMenu(); + label->showMenu(); +} + QAction* LDesktopSwitcher::newAction(int what, QString name) { QAction *act = new QAction(LXDG::findIcon("preferences-desktop-display-color", ":/images/preferences-desktop-display-color.png"), name, this); act->setWhatsThis(QString::number(what)); diff --git a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.h b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.h index 5dd5a785..851d9e35 100644 --- a/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.h +++ b/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.h @@ -46,6 +46,7 @@ private: QAction* newAction(int, QString); private slots: + void openMenu(); void createMenu(); void menuActionTriggered(QAction*); |