on xenial help sign in
fade out launcher in place instead of animating to the left in some circumstances
e96f0deMichael Zanetti
qml/Launcher/Launcher.qml+32−2
@@ -55,6 +55,10 @@ Item {
55 switchToNextState("")
55 switchToNextState("")
56 }
56 }
57
57
58+ function fadeOut() {
59+ fadeOutAnimation.start();
60+ }
61+
58 function switchToNextState(state) {
62 function switchToNextState(state) {
59 animateTimer.nextState = state
63 animateTimer.nextState = state
60 animateTimer.start();
64 animateTimer.start();
@@ -99,6 +103,31 @@ Item {
99 }
103 }
100 }
104 }
101
105
106+ SequentialAnimation {
107+ id: fadeOutAnimation
108+ ScriptAction {
109+ script: {
110+ panel.layer.enabled = true
111+ }
112+ }
113+ UbuntuNumberAnimation {
114+ target: panel
115+ property: "opacity"
116+ easing.type: Easing.InQuad
117+ to: 0
118+ }
119+ ScriptAction {
120+ script: {
121+ panel.layer.enabled = false
122+ panel.animate = false;
123+ root.state = "";
124+ panel.x = -panel.width
125+ panel.opacity = 1;
126+ panel.animate = true;
127+ }
128+ }
129+ }
130+
102 MouseArea {
131 MouseArea {
103 id: launcherDragArea
132 id: launcherDragArea
104 enabled: root.state == "visible"
133 enabled: root.state == "visible"
@@ -175,7 +204,7 @@ Item {
175 Behavior on x {
204 Behavior on x {
176 NumberAnimation {
205 NumberAnimation {
177 // Disabling animation when dragging
206 // Disabling animation when dragging
178− duration: dragArea.dragging || launcherDragArea.drag.active ? 0 : 300;
207+ duration: dragArea.dragging || launcherDragArea.drag.active || !panel.animate ? 0 : 300;
179 easing.type: Easing.OutCubic
208 easing.type: Easing.OutCubic
180 }
209 }
181 }
210 }
@@ -215,9 +244,10 @@ Item {
215 onDraggingChanged: {
244 onDraggingChanged: {
216 if (!dragging) {
245 if (!dragging) {
217 if (distance > panel.width / 2) {
246 if (distance > panel.width / 2) {
218− root.switchToNextState("visible")
219 if (distance > minimizeDistance) {
247 if (distance > minimizeDistance) {
220 root.dash()
248 root.dash()
249+ } else {
250+ root.switchToNextState("visible")
221 }
251 }
222 } else {
252 } else {
223 root.switchToNextState("")
253 root.switchToNextState("")
qml/Shell.qml+6−5
@@ -509,12 +509,13 @@ FocusScope {
509 showHome()
509 showHome()
510 }
510 }
511 onDash: {
511 onDash: {
512− if (stages.shown && !stages.overlayMode) {
512+ if (stages.shown && !stages.overlayMode && !stages.locked) {
513− if (!stages.locked) {
514− stages.hide();
513+ stages.hide();
515− launcher.hide();
514+ launcher.fadeOut();
516− }
515+ } else {
516+ launcher.switchToNextState("visible");
517 }
517 }
518+
518 if (greeter.shown) {
519 if (greeter.shown) {
519 greeter.hideRight();
520 greeter.hideRight();
520 launcher.hide();
521 launcher.hide();