on xenial help sign in
Show/hide stages according to ApplicationManager events
35cec56Daniel d'Andrada
qml/Shell.qml+18−1
@@ -178,10 +178,18 @@ FocusScope {
178 height: parent.height
178 height: parent.height
179 color: "khaki"
179 color: "khaki"
180
180
181+ visible: !fullyHidden
182+
181 x: shown ? launcher.progress : stagesDragArea.progress
183 x: shown ? launcher.progress : stagesDragArea.progress
182 //Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
184 //Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
183
185
184 property bool shown: false
186 property bool shown: false
187+ onShownChanged: {
188+ if (!shown && ApplicationManager.focusedApplicationId) {
189+ ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
190+ ApplicationManager.unfocusCurrentApplication();
191+ }
192+ }
185
193
186 // Avoid a silent "divide by zero -> NaN" situation during init as shell.width will be
194 // Avoid a silent "divide by zero -> NaN" situation during init as shell.width will be
187 // zero. That breaks the property binding and the function won't be reevaluated once
195 // zero. That breaks the property binding and the function won't be reevaluated once
@@ -192,16 +200,25 @@ FocusScope {
192 property bool fullyHidden: x == width
200 property bool fullyHidden: x == width
193
201
194 property bool empty: SurfaceManager.count == 0
202 property bool empty: SurfaceManager.count == 0
203+ onEmptyChanged: {
204+ if (empty) {
205+ hide();
206+ }
207+ }
195
208
196 function show() {
209 function show() {
197 shown = true;
210 shown = true;
198−// panel.indicators.hide();
199 }
211 }
200
212
201 function hide() {
213 function hide() {
202 shown = false;
214 shown = false;
203 }
215 }
204
216
217+ Connections {
218+ target: ApplicationManager
219+ onFocusRequested: { stages.show(); }
220+ }
221+
205 Loader {
222 Loader {
206 id: applicationsDisplayLoader
223 id: applicationsDisplayLoader
207 anchors.fill: parent
224 anchors.fill: parent