diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp index a0c42774..8e0a9d28 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp @@ -29,6 +29,9 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal) QTimer::singleShot(500, this, SLOT(createMenu()) ); //needs a delay to make sure it works right the first time QTimer::singleShot(0,this, SLOT(OrientationChange()) ); //adjust icon size + + //Process the signal which is sent when the workspace is changed via keyboard-shortcuts + connect(QApplication::instance(), SIGNAL(WorkspaceChanged()), this, SLOT(updateWorkspaceMenu())); } LDesktopSwitcher::~LDesktopSwitcher(){ @@ -133,10 +136,13 @@ void LDesktopSwitcher::createMenu() { if(i == cur){ name.prepend("*"); name.append("*");} //identify which desktop this is currently menu->addAction(newAction(i, name)); } + label->setToolTip(QString(tr("Workspace %1")).arg(QString::number(cur + 1))); } void LDesktopSwitcher::menuActionTriggered(QAction* act) { LSession::handle()->XCB->SetCurrentWorkspace(act->whatsThis().toInt()); - label->setToolTip(QString(tr("Workspace %1")).arg(act->whatsThis().toInt() +1)); - QTimer::singleShot(500, this, SLOT(createMenu()) ); //make sure the menu gets updated +} + +void LDesktopSwitcher::updateWorkspaceMenu() { + createMenu(); } |