on xenial help sign in
Show/hide stages according to ApplicationManager events

+ update app. screenshot when hiding stages

commit35cec567ceac87e59c46feb8e113a7b905452833 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 20 May 2014, 10:54 (12 years ago) parent9e775f2
1 file changed+18−1
qml/Shell.qml+18−1
qml/Shell.qml+18−1
@@ -178,10 +178,18 @@ FocusScope {
178178 height: parent.height
179179 color: "khaki"
180180
181+ visible: !fullyHidden
182+
181183 x: shown ? launcher.progress : stagesDragArea.progress
182184 //Behavior on x { SmoothedAnimation { velocity: 600; duration: UbuntuAnimation.FastDuration } }
183185
184186 property bool shown: false
187+ onShownChanged: {
188+ if (!shown && ApplicationManager.focusedApplicationId) {
189+ ApplicationManager.updateScreenshot(ApplicationManager.focusedApplicationId);
190+ ApplicationManager.unfocusCurrentApplication();
191+ }
192+ }
185193
186194 // Avoid a silent "divide by zero -> NaN" situation during init as shell.width will be
187195 // zero. That breaks the property binding and the function won't be reevaluated once
@@ -192,16 +200,25 @@ FocusScope {
192200 property bool fullyHidden: x == width
193201
194202 property bool empty: SurfaceManager.count == 0
203+ onEmptyChanged: {
204+ if (empty) {
205+ hide();
206+ }
207+ }
195208
196209 function show() {
197210 shown = true;
198−// panel.indicators.hide();
199211 }
200212
201213 function hide() {
202214 shown = false;
203215 }
204216
217+ Connections {
218+ target: ApplicationManager
219+ onFocusRequested: { stages.show(); }
220+ }
221+
205222 Loader {
206223 id: applicationsDisplayLoader
207224 anchors.fill: parent