on xenial help sign in
hide/show improvements for sidestage+dash
66e0bd0Albert Astals
qml/Components/Showable.qml+8
@@ -107,6 +107,9 @@ Item {
107 if (!hideAnimation.running) {
107 if (!hideAnimation.running) {
108 hideAnimation.restart()
108 hideAnimation.restart()
109 }
109 }
110+ if (__skipShowAnimation) {
111+ hideAnimation.complete();
112+ }
110 } else {
113 } else {
111 visible = false
114 visible = false
112 required = false
115 required = false
@@ -115,6 +118,11 @@ Item {
115 shown = false
118 shown = false
116 }
119 }
117
120
121+ function hideNow() {
122+ __skipShowAnimation = true;
123+ hide();
124+ }
125+
118 Connections {
126 Connections {
119 target: hideAnimation ? hideAnimation: null
127 target: hideAnimation ? hideAnimation: null
120 onRunningChanged: {
128 onRunningChanged: {
qml/Shell.qml+25−12
@@ -229,10 +229,10 @@ FocusScope {
229 }
229 }
230
230
231 AbstractButton {
231 AbstractButton {
232− enabled: stagesOuterContainer.showProgress == 1
232+ enabled: mainStage.applications.count == 0 && sideStage.shown
233 anchors.fill: parent
233 anchors.fill: parent
234 onClicked: {
234 onClicked: {
235− stages.hide();
235+ sideStage.hide();
236 }
236 }
237 }
237 }
238 }
238 }
@@ -243,7 +243,7 @@ FocusScope {
243
243
244 width: parent.width
244 width: parent.width
245 height: parent.height
245 height: parent.height
246− x: launcher.progress
246+ x: mainStage.applications.count > 0 ? launcher.progress : 0
247 Behavior on x {SmoothedAnimation{velocity: 600}}
247 Behavior on x {SmoothedAnimation{velocity: 600}}
248
248
249 property real showProgress:
249 property real showProgress:
@@ -255,6 +255,16 @@ FocusScope {
255
255
256 x: width
256 x: width
257
257
258+ function doLauncherHide() {
259+ if (mainStage.applications.count > 0) {
260+ hide();
261+ } else {
262+ if (sideStage.shown) {
263+ sideStage.hide();
264+ }
265+ }
266+ }
267+
258 property bool fullyShown: shown && x == 0 && parent.x == 0
268 property bool fullyShown: shown && x == 0 && parent.x == 0
259 property bool fullyHidden: !shown && x == width
269 property bool fullyHidden: !shown && x == width
260 available: !greeter.shown
270 available: !greeter.shown
@@ -339,11 +349,6 @@ FocusScope {
339 rightEdgeDraggingAreaWidth: shell.edgeSize
349 rightEdgeDraggingAreaWidth: shell.edgeSize
340 normalApplicationY: shell.panelHeight
350 normalApplicationY: shell.panelHeight
341
351
342− onShownChanged: {
343− if (!shown && mainStage.applications.count == 0) {
344− stages.hide();
345− }
346− }
347 // FIXME: when hiding the side stage, refocus the main stage
352 // FIXME: when hiding the side stage, refocus the main stage
348 // application so that it goes in front of the side stage
353 // application so that it goes in front of the side stage
349 // application and hides it
354 // application and hides it
@@ -372,8 +377,16 @@ FocusScope {
372 Connections {
377 Connections {
373 target: sideStage.applications
378 target: sideStage.applications
374 onCountChanged: {
379 onCountChanged: {
380+ if (sideStage.applications.count == 0) {
375− if (sideStage.applications.count == 0 && sideStage.shown) { // if all SS app closed, hide side stage
381+ if (sideStage.shown) { // if all SS app closed, hide side stage
376− sideStage.hide();
382+ sideStage.hide();
383+ } else {
384+ // Sidestage is hidden and there is no main app, make sure the
385+ // stages is totally hidden too
386+ if (mainStage.applications.count == 0) {
387+ stages.hideNow();
388+ }
389+ }
377 }
390 }
378 }
391 }
379 }
392 }
@@ -588,7 +601,7 @@ FocusScope {
588
601
589 InputFilterArea {
602 InputFilterArea {
590 width: {
603 width: {
591− if (applicationManager.sideStageFocusedApplication)
604+ if (applicationManager.sideStageFocusedApplication && sideStage.shown)
592 return parent.width - sideStage.width;
605 return parent.width - sideStage.width;
593 else
606 else
594 return parent.width;
607 return parent.width;
@@ -728,7 +741,7 @@ FocusScope {
728 }
741 }
729 onDash: {
742 onDash: {
730 if (stages.shown) {
743 if (stages.shown) {
731− stages.hide();
744+ stages.doLauncherHide();
732 launcher.hide();
745 launcher.hide();
733 }
746 }
734 }
747 }