on xenial help sign in
Fade out launcher in place instead of moving it to the left on long left edge swipes. Fixes: 1332096

Approved by: Vesa Rautiainen, Michał Sawicz, PS Jenkins bot

commite574a866bf901907668efd01d481c8d0a585b33c authorMichael Zanetti <michael.zanetti@canonical.com> dateWed 9 Jul 2014, 19:42 (12 years ago) parent09416c7959dc83
2 files changed+40−9
qml/Launcher/Launcher.qml+33−3 qml/Shell.qml+7−6
qml/Launcher/Launcher.qml+33−3
@@ -55,6 +55,10 @@ Item {
5555 switchToNextState("")
5656 }
5757
58+ function fadeOut() {
59+ fadeOutAnimation.start();
60+ }
61+
5862 function switchToNextState(state) {
5963 animateTimer.nextState = state
6064 animateTimer.start();
@@ -99,6 +103,31 @@ Item {
99103 }
100104 }
101105
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+
102131 MouseArea {
103132 id: launcherDragArea
104133 enabled: root.state == "visible"
@@ -173,9 +202,9 @@ Item {
173202 }
174203
175204 Behavior on x {
205+ enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate;
176206 NumberAnimation {
177− // Disabling animation when dragging
178− duration: dragArea.dragging || launcherDragArea.drag.active ? 0 : 300;
207+ duration: 300
179208 easing.type: Easing.OutCubic
180209 }
181210 }
@@ -215,9 +244,10 @@ Item {
215244 onDraggingChanged: {
216245 if (!dragging) {
217246 if (distance > panel.width / 2) {
218− root.switchToNextState("visible")
219247 if (distance > minimizeDistance) {
220248 root.dash()
249+ } else {
250+ root.switchToNextState("visible")
221251 }
222252 } else {
223253 root.switchToNextState("")
qml/Shell.qml+7−6
@@ -534,15 +534,16 @@ FocusScope {
534534 showHome()
535535 }
536536 onDash: {
537− if (stages.shown && !stages.overlayMode) {
538− if (!stages.locked) {
539− stages.hide();
540− launcher.hide();
541− }
537+ if (stages.shown && !stages.overlayMode && !stages.locked) {
538+ stages.hide();
539+ launcher.fadeOut();
540+ } else {
541+ launcher.switchToNextState("visible");
542542 }
543+
543544 if (greeter.shown) {
544545 greeter.hideRight();
545− launcher.hide();
546+ launcher.fadeOut();
546547 }
547548 }
548549 onDashSwipeChanged: if (dashSwipe && stages.shown) dash.setCurrentScope("clickscope", false, true)