on xenial help sign in
dekstop stage item visibility
0e7e1bfNick Dedekind
qml/Stages/DesktopStage.qml+18
@@ -65,6 +65,11 @@ Rectangle {
65
65
66 ApplicationManager.requestFocusApplication(appId)
66 ApplicationManager.requestFocusApplication(appId)
67 }
67 }
68+ onApplicationRemoved: {
69+ if (priv.foregroundMaximizedAppId === appId) {
70+ priv.foregroundMaximizedAppId = "";
71+ }
72+ }
68
73
69 onFocusRequested: {
74 onFocusRequested: {
70 var appIndex = priv.indexOf(appId);
75 var appIndex = priv.indexOf(appId);
@@ -86,6 +91,7 @@ Rectangle {
86 var index = indexOf(focusedAppId);
91 var index = indexOf(focusedAppId);
87 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
92 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
88 }
93 }
94+ property string foregroundMaximizedAppId: ""
89
95
90 function indexOf(appId) {
96 function indexOf(appId) {
91 for (var i = 0; i < ApplicationManager.count; i++) {
97 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -150,6 +156,18 @@ Rectangle {
150 }
156 }
151 }
157 }
152
158
159+ readonly property bool foregroundMaximized: maximized && index == 0
160+ onForegroundMaximizedChanged: {
161+ if (foregroundMaximized) {
162+ priv.foregroundMaximizedAppId = model.appId;
163+ } else if (priv.foregroundMaximizedAppId === model.appId) {
164+ priv.foregroundMaximizedAppId = "";
165+ }
166+ }
167+
168+ visible: !minimized &&
169+ (priv.foregroundMaximizedAppId === "" || priv.foregroundMaximizedAppId === model.appId)
170+
153 Binding {
171 Binding {
154 target: ApplicationManager.get(index)
172 target: ApplicationManager.get(index)
155 property: "requestedState"
173 property: "requestedState"