@@ -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("")