aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp')
-rw-r--r--lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp9
1 files changed, 8 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));
bgstack15