on xenial help sign in
Fade out launcher in place instead of moving it to the left on long left edge swipes. Fixes: 1332096
e574a86Michael Zanetti
qml/Launcher/Launcher.qml+33−3
@@ -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"
@@ -173,9 +202,9 @@ Item {
173 }
202 }
174
203
175 Behavior on x {
204 Behavior on x {
205+ enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;
176 NumberAnimation {
206 NumberAnimation {
177− // Disabling animation when dragging
207+ duration: 300
178− duration: dragArea.dragging || launcherDragArea.drag.active ? 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+7−6
@@ -534,15 +534,16 @@ FocusScope {
534 showHome()
534 showHome()
535 }
535 }
536 onDash: {
536 onDash: {
537− if (stages.shown && !stages.overlayMode) {
537+ if (stages.shown && !stages.overlayMode && !stages.locked) {
538− if (!stages.locked) {
539− stages.hide();
538+ stages.hide();
540− launcher.hide();
539+ launcher.fadeOut();
541− }
540+ } else {
541+ launcher.switchToNextState("visible");
542 }
542 }
543+
543 if (greeter.shown) {
544 if (greeter.shown) {
544 greeter.hideRight();
545 greeter.hideRight();
545− launcher.hide();
546+ launcher.fadeOut();
546 }
547 }
547 }
548 }
548 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)
549 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)