@@ -20,7 +20,7 @@ import Ubuntu.Gestures 0.1
20import LightDM 0.1 as LightDM
20import LightDM 0.1 as LightDM
21import "../Components"
21import "../Components"
24 id: greeter
24 id: greeter
25 enabled: visible
25 enabled: visible
@@ -28,39 +28,19 @@ Item {
29 property url background
29 property url background
31− property bool shown: true
32− function showNow() {
31+ function hideRight() {
33− shown = true;
32+ d.forceRightOnNextHideAnimation = true;
34− positionLock.disable();
33+ hide();
36− greeter.visible = true;
40− hideAnimation.stop();
41− showAnimation.start();
45− greeter.x = -greeter.width;
46− greeter.visible = false;
47− positionLock.enable();
49− function hide() {
36+ prepareToHide: function () {
51− showAnimation.stop();
52− if (!hideAnimation.running) {
53− hideTranslation.to = greeter.x > 0 ? greeter.width : -greeter.width;
37+ hideTranslation.to = greeter.x > 0 || d.forceRightOnNextHideAnimation ? greeter.width : -greeter.width;
54− hideAnimation.start();
38+ d.forceRightOnNextHideAnimation = false;
57− function hideRight() {
40+
58− shown = false;
41+ QtObject {
59− showAnimation.stop();
42+ id: d
60− if (!hideAnimation.running) {
43+ property bool forceRightOnNextHideAnimation: false
61− hideTranslation.to = greeter.width;
62− hideAnimation.start();
66 // <dandrader> Is this really necessary?
46 // <dandrader> Is this really necessary?
@@ -190,22 +170,21 @@ Item {
190 Binding {
170 Binding {
191 id: positionLock
171 id: positionLock
193− function enable() {
173+ property bool enabled: false
194− if (__enabled) {
175+ if (enabled === __enabled) {
198− if (greeter.x > 0) {
180+ if (greeter.x > 0) {
199− value = Qt.binding(function() { return greeter.width; })
181+ value = Qt.binding(function() { return greeter.width; })
200− } else {
182+ } else {
201− value = Qt.binding(function() { return -greeter.width; })
183+ value = Qt.binding(function() { return -greeter.width; })
204− __enabled = true;
187+ __enabled = enabled;
207− function disable() {
211 property bool __enabled: false
190 property bool __enabled: false
@@ -215,7 +194,7 @@ Item {
215 property: "x"
194 property: "x"
218− SequentialAnimation {
197+ hideAnimation: SequentialAnimation {
219 id: hideAnimation
198 id: hideAnimation
220 objectName: "hideAnimation"
199 objectName: "hideAnimation"
221 StandardAnimation {
200 StandardAnimation {
@@ -224,19 +203,15 @@ Item {
224 target: greeter
203 target: greeter
225 duration: UbuntuAnimation.FastDuration
204 duration: UbuntuAnimation.FastDuration
227− ScriptAction { script: {
228− greeter.visible = false;
206+ PropertyAction { target: greeter; property: "visible"; value: false }
229− positionLock.enable();
207+ PropertyAction { target: positionLock; property: "enabled"; value: true }
233− SequentialAnimation {
210+ showAnimation: SequentialAnimation {
234 id: showAnimation
211 id: showAnimation
235 objectName: "showAnimation"
212 objectName: "showAnimation"
236− ScriptAction { script: {
237− greeter.visible = true;
213+ PropertyAction { target: greeter; property: "visible"; value: true }
238− positionLock.disable();
214+ PropertyAction { target: positionLock; property: "enabled"; value: false }
240 StandardAnimation {
215 StandardAnimation {
241 property: "x"
216 property: "x"
242 target: greeter
217 target: greeter