diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-11 19:51:17 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-11 19:51:17 -0400 |
commit | 9f902f3c03fbcd6702f7e206e18aea086e35b70e (patch) | |
tree | 4ec9e77d72eff3b6419855a59ae606f49b4057a9 /src-qt5/core/lumina-desktop | |
parent | Cleanup a bit more of the lumina-terminal. Color support is now in (with "xte... (diff) | |
download | lumina-9f902f3c03fbcd6702f7e206e18aea086e35b70e.tar.gz lumina-9f902f3c03fbcd6702f7e206e18aea086e35b70e.tar.bz2 lumina-9f902f3c03fbcd6702f7e206e18aea086e35b70e.zip |
Get the lumina desktop all setup with a registration system for start-menu-like plugins to determine whether they should respond to a show command, and setup all the systemstart plugins to use this system (will expand later to the appmenu and userbutton plugins as well).
Diffstat (limited to 'src-qt5/core/lumina-desktop')
5 files changed, 39 insertions, 2 deletions
diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index a6821ed7..42eb6bc7 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -253,6 +253,8 @@ void LSession::NewCommunication(QStringList list){ for(int i=0; i<list.length(); i++){ if(list[i]=="--check-geoms"){ screensChanged(); + }else if(list[i]=="--show-start"){ + emit StartButtonActivated(); } } } @@ -897,3 +899,17 @@ void LSession::removeTrayWindow(WId win){ } } } +//========================= +// START MENU FUNCTIONS +//========================= +bool LSession::registerStartButton(QString ID){ + if(StartButtonID.isEmpty()){ StartButtonID = ID; } + return (StartButtonID==ID); +} + +void LSession::unregisterStartButton(QString ID){ + if(StartButtonID == ID){ + StartButtonID.clear(); + emit StartButtonAvailable(); + } +} diff --git a/src-qt5/core/lumina-desktop/LSession.h b/src-qt5/core/lumina-desktop/LSession.h index bdcc94a4..d046bdc7 100644 --- a/src-qt5/core/lumina-desktop/LSession.h +++ b/src-qt5/core/lumina-desktop/LSession.h @@ -59,6 +59,10 @@ public: bool registerVisualTray(WId); void unregisterVisualTray(WId); + //Public start menu buttons + bool registerStartButton(QString ID); + void unregisterStartButton(QString ID); + //Special functions for XCB event filter parsing only // (DO NOT USE MANUALLY) void RootSizeChange(); @@ -121,6 +125,8 @@ private: int TrayDmgEvent, TrayDmgError; QList<WId> RunningTrayApps; bool TrayStopping; + //Start Button Variables + QString StartButtonID; //Task Manager Variables WId lastActiveWin; @@ -167,6 +173,9 @@ signals: void VisualTrayAvailable(); //new Visual Tray Plugin can be registered void TrayListChanged(); //Item added/removed from the list void TrayIconChanged(WId); //WinID of Tray App + //Start Button signals + void StartButtonAvailable(); + void StartButtonActivated(); //Task Manager Signals void WindowListEvent(WId); void WindowListEvent(); diff --git a/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys b/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys index d2d3664f..ca2db698 100644 --- a/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys +++ b/src-qt5/core/lumina-desktop/fluxboxconf/fluxbox-keys @@ -149,3 +149,4 @@ Mod4 Next :Exec lumina-open -volumedown Mod4 Home :Exec lumina-open -brightnessup Mod4 End :Exec lumina-open -brightnessdown F12 :Exec lumina-terminal -toggle +Mod4 :Exec lumina-desktop --show-start 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 |