diff options
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/appmenu')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp | 10 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.h | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp b/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp index 7c9b7ab0..57e84a1d 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.cpp @@ -24,6 +24,9 @@ LAppMenuPlugin::LAppMenuPlugin(QWidget *parent, QString id, bool horizontal) : L connect(LSession::handle()->applicationMenu(), SIGNAL(AppMenuUpdated()), this, SLOT(UpdateMenu())); QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes QTimer::singleShot(0,this, SLOT(UpdateMenu()) ); + //Setup the global shortcut handling for opening the start menu + connect(QApplication::instance(), SIGNAL(StartButtonActivated()), this, SLOT(shortcutActivated()) ); + LSession::handle()->registerStartButton(this->type()); } LAppMenuPlugin::~LAppMenuPlugin(){ @@ -40,6 +43,13 @@ void LAppMenuPlugin::updateButtonVisuals(){ // ======================== // PRIVATE FUNCTIONS // ======================== +void LAppMenuPlugin::shortcutActivated(){ + if(LSession::handle()->registerStartButton(this->type())){ + if(button->menu()->isVisible()){ button->menu()->hide(); } + else{ button->showMenu(); } + } +} + void LAppMenuPlugin::LaunchItem(QAction* item){ QString appFile = item->whatsThis(); if(appFile.startsWith("internal::")){ diff --git a/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.h b/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.h index 36cd8605..659d781f 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.h +++ b/src-qt5/core/lumina-desktop/panel-plugins/appmenu/LAppMenuPlugin.h @@ -35,6 +35,7 @@ private: void updateButtonVisuals(); private slots: + void shortcutActivated(); void LaunchItem(QAction* item); void UpdateMenu(); @@ -60,4 +61,4 @@ public slots: } }; -#endif
\ No newline at end of file +#endif |