aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-31 08:47:21 -0400
committerKen Moore <ken@ixsystems.com>2017-08-31 08:47:21 -0400
commit0bce08ce5c6fa073b0c9e299ab619d35ecdceef6 (patch)
treeca819bd27c14ae05d6c65164f84f41cab3916430 /src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
parentA couple more minor tweaks. (diff)
downloadlumina-0bce08ce5c6fa073b0c9e299ab619d35ecdceef6.tar.gz
lumina-0bce08ce5c6fa073b0c9e299ab619d35ecdceef6.tar.bz2
lumina-0bce08ce5c6fa073b0c9e299ab619d35ecdceef6.zip
A but more work on Lumina2:
1. Get the menu-based task manager up and running. 2. Get the minimize button setup with normal functionality now (since we can restore it) 3. Get the maximize button logic setup - still testing this 4. Get the window movement animation system setup - still testing this for the maximize functionality 5. Cleanup a bit more of the backend "pause" for windows during animations.
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp')
-rw-r--r--src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
index 1b5512ff..143a3667 100644
--- a/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
+++ b/src-qt5/core/lumina-desktop-unified/src-desktop/ContextMenu.cpp
@@ -64,6 +64,17 @@ void DesktopContextMenu::UpdateMenu(bool fast){
this->addAction(LXDG::findIcon("system-log-out",""), tr("Leave"), this, SIGNAL(showLeaveDialog()) );
}
+// === PRIVATE ===
+void DesktopContextMenu::AddWindowToMenu(NativeWindow *win){
+ QString label = win->property(NativeWindow::ShortTitle).toString();
+ if(label.isEmpty()){ label = win->property(NativeWindow::Title).toString(); }
+ if(label.isEmpty()){ label = win->property(NativeWindow::Name).toString(); }
+ QAction *tmp = winMenu->addAction( win->property(NativeWindow::Icon).value<QIcon>(), label, win, SLOT(toggleVisibility()) );
+ //Need to change the visual somehow to indicate whether it is visible or not
+ //bool visible = win->property(NativeWindow::Visible).toBool();
+ // TODO
+}
+
// === PUBLIC ===
DesktopContextMenu::DesktopContextMenu(QWidget *parent) : QMenu(parent){
if(parent!=0){
@@ -150,4 +161,15 @@ void DesktopContextMenu::updateWinMenu(){
winMenu = new QMenu(this);
winMenu->setTitle( tr("Task Manager") );
}
+ winMenu->clear();
+ QList<NativeWindow*> wins = Lumina::NWS->currentWindows();
+ unsigned int wkspace = Lumina::NWS->currentWorkspace();
+ for(int i=0; i<wins.length(); i++){
+ //First check if this window is in the current workspace (or is "sticky")
+ if(wins.at(i)->property(NativeWindow::Workspace).toUInt() != wkspace
+ && wins.at(i)->property(NativeWindow::States).value< QList<NativeWindow::State> >().contains(NativeWindow::S_STICKY) ){
+ continue;
+ }
+ AddWindowToMenu(wins.at(i));
+ }
}
bgstack15