@@ -110,20 +110,18 @@ Showable {
110 property int delayMinutes
110 property int delayMinutes
111 property bool waiting
111 property bool waiting
113− // We define a proxy and "is valid" property for launcherOffset because of
113+ // We want 'launcherOffset' to animate down to zero. But not to animate
114− // a quirk in Qml. We only want this animation to fire if we are reset
114+ // while being dragged. So ideally we change this only when the user
115− // back to zero (on a release of the drag). But by defining a Behavior,
115+ // lets go and launcherOffset drops to zero. But we need to wait for
116− // we delay the property from reaching zero until it's too late. So we set
116+ // the behavior to be enabled first. So we cache the last known good
117− // a proxy bound to launcherOffset, which lets us see the target value of
117+ // launcherOffset value to cover us during that brief gap between
118− // zero as we also slowly adjust the proxy down to zero. But Qml will send
118+ // release and the behavior turning on.
119− // change notifications in declaration order. So unless we define the
119+ property real lastKnownPositiveOffset // set in a launcherOffsetChanged below
120− // proxy first, we need a little "is valid" property defined above the
121− // proxy, so we know when to enable the proxy behavior. Phew!
122− readonly property bool launcherOffsetValid: launcherOffset > 0
123− property real launcherOffsetProxy: shown ? launcherOffset : 0
120+ property real launcherOffsetProxy: (shown && !launcherOffsetProxyBehavior.enabled) ? lastKnownPositiveOffset : 0
124 Behavior on launcherOffsetProxy {
121 Behavior on launcherOffsetProxy {
125− enabled: !d.launcherOffsetValid
122+ id: launcherOffsetProxyBehavior
126− StandardAnimation {}
123+ enabled: launcherOffset === 0
124+ UbuntuNumberAnimation {}
129 function selectUser(uid, reset) {
127 function selectUser(uid, reset) {
@@ -156,6 +154,12 @@ Showable {
157+ onLauncherOffsetChanged: {
158+ if (launcherOffset > 0) {
159+ d.lastKnownPositiveOffset = launcherOffset;
159 onForcedUnlockChanged: {
163 onForcedUnlockChanged: {
160 if (forcedUnlock && shown) {
164 if (forcedUnlock && shown) {
161 // pretend we were just authenticated
165 // pretend we were just authenticated