diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/systemstart')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp | 12 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.h | 3 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp index d57846e2..f817e0c0 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp @@ -33,10 +33,13 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) ); QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes QTimer::singleShot(0, startmenu, SLOT(ReLoadQuickLaunch()) ); + //Setup the global shortcut handling for opening the start menu + connect(QApplication::instance(), SIGNAL(StartButtonActivated()), this, SLOT(shortcutActivated()) ); + LSession::handle()->registerStartButton(this->type()); } LStartButtonPlugin::~LStartButtonPlugin(){ - + LSession::handle()->unregisterStartButton(this->type()); } void LStartButtonPlugin::updateButtonVisuals(){ @@ -117,3 +120,10 @@ void LStartButtonPlugin::openMenu(){ void LStartButtonPlugin::closeMenu(){ menu->hide(); } + +void LStartButtonPlugin::shortcutActivated(){ + if(LSession::handle()->registerStartButton(this->type())){ + if(menu->isVisible()){ closeMenu(); } + else{ openMenu(); } + } +} diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.h b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.h index f549b8d2..a7d98353 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.h +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.h @@ -74,6 +74,7 @@ private: private slots: void openMenu(); void closeMenu(); + void shortcutActivated(); void updateButtonVisuals(); @@ -108,4 +109,4 @@ public slots: } }; -#endif
\ No newline at end of file +#endif |