on xenial help sign in
fade out launcher in place instead of animating to the left in some circumstances
commite96f0deece0f3dbc94be3a9bc34771958222c801 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 20 Jun 2014, 18:48 (12 years ago) parente82a901
2 files changed+38−7
qml/Launcher/Launcher.qml+32−2 qml/Shell.qml+6−5
qml/Launcher/Launcher.qml+32−2
@@ -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"
@@ -175,7 +204,7 @@ Item {
175204 Behavior on x {
176205 NumberAnimation {
177206 // Disabling animation when dragging
178− duration: dragArea.dragging || launcherDragArea.drag.active ? 0 : 300;
207+ duration: dragArea.dragging || launcherDragArea.drag.active || !panel.animate ? 0 : 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+6−5
@@ -509,12 +509,13 @@ FocusScope {
509509 showHome()
510510 }
511511 onDash: {
512− if (stages.shown && !stages.overlayMode) {
513− if (!stages.locked) {
514− stages.hide();
515− launcher.hide();
516− }
512+ if (stages.shown && !stages.overlayMode && !stages.locked) {
513+ stages.hide();
514+ launcher.fadeOut();
515+ } else {
516+ launcher.switchToNextState("visible");
517517 }
518+
518519 if (greeter.shown) {
519520 greeter.hideRight();
520521 launcher.hide();