diff options
author | Ken Moore <moorekou@gmail.com> | 2016-06-29 14:29:00 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-06-29 14:29:00 -0400 |
commit | ec1e0ce441081627b53733cdf0981af13c25bbc1 (patch) | |
tree | 8f22b767caec13e14aff720579a71ff69ca37f7a /src-qt5/core/lumina-desktop | |
parent | Fix up the resizeMenu's mouse event handling to ensure it keeps control of th... (diff) | |
download | lumina-ec1e0ce441081627b53733cdf0981af13c25bbc1.tar.gz lumina-ec1e0ce441081627b53733cdf0981af13c25bbc1.tar.bz2 lumina-ec1e0ce441081627b53733cdf0981af13c25bbc1.zip |
Add options for grouped windows in the task manager:
Show All Windows
Minimize All Windows
Close All Windows
Diffstat (limited to 'src-qt5/core/lumina-desktop')
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp | 29 | ||||
-rw-r--r-- | src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h | 3 |
2 files changed, 32 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp index 7e2e53de..0dd68bb0 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.cpp @@ -157,6 +157,12 @@ void LTaskButton::UpdateMenus(){ } } actMenu->addAction( LXDG::findIcon("window-close",""), tr("Close Window"), this, SLOT(closeWindow()) ); + if(WINLIST.length()>1 && !winMenu->isVisible()){ + actMenu->addSeparator(); + actMenu->addAction( LXDG::findIcon("layer-visible-on",""), tr("Show All Windows"), this, SLOT(showAllWindows()) ); + actMenu->addAction( LXDG::findIcon("layer-visible-off",""), tr("Minimize All Windows"), this, SLOT(hideAllWindows()) ); + actMenu->addAction( LXDG::findIcon("window-close",""), tr("Close All Windows"), this, SLOT(closeAllWindows()) ); + } } //============= @@ -196,6 +202,29 @@ void LTaskButton::minimizeWindow(){ QTimer::singleShot(100, this, SLOT(UpdateButton()) ); //make sure to update this button if losing active status } +void LTaskButton::showAllWindows(){ + for(int i=WINLIST.length()-1; i>=0; i--){ + if(WINLIST[i].status()==LXCB::INVISIBLE){ + LSession::handle()->XCB->RestoreWindow(WINLIST[i].windowID()); + } + } +} + +void LTaskButton::hideAllWindows(){ + for(int i=WINLIST.length()-1; i>=0; i--){ + LXCB::WINDOWVISIBILITY state = WINLIST[i].status(); + if(state==LXCB::VISIBLE || state==LXCB::ACTIVE){ + LSession::handle()->XCB->MinimizeWindow(WINLIST[i].windowID()); + } + } +} + +void LTaskButton::closeAllWindows(){ + for(int i=WINLIST.length()-1; i>=0; i--){ + LSession::handle()->XCB->CloseWindow(WINLIST[i].windowID()); + } +} + void LTaskButton::triggerWindow(){ LWinInfo win = currentWindow(); //Check which state the window is currently in and flip it to the other diff --git a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h index 43dbaa90..6b171c6a 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h +++ b/src-qt5/core/lumina-desktop/panel-plugins/taskmanager/LTaskButton.h @@ -60,6 +60,9 @@ private slots: void closeWindow(); //send the signal to close a window void maximizeWindow(); //send the signal to maximize/restore a window void minimizeWindow(); //send the signal to minimize a window (iconify) + void showAllWindows(); + void hideAllWindows(); + void closeAllWindows(); void triggerWindow(); //change b/w visible and invisible void winClicked(QAction*); void openActionMenu(); |