on xenial help sign in
Don't animate x while dragging apps from the left edge Fixes: 1360105

Approved by: Daniel d'Andrada

commit2c7808f7f0baa15dbae57a3cf93d6e288c0e5998 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 8 Sep 2014, 14:16 (12 years ago) parent473ab33aaf73c9
3 files changed+13−2
qml/Stages/PhoneStage.qml+6−1 qml/Stages/TabletStage.qml+5 qml/Stages/TransformedTabletSpreadDelegate.qml+2−1
qml/Stages/PhoneStage.qml+6−1
@@ -44,6 +44,9 @@ Rectangle {
4444 }
4545
4646 onInverseProgressChanged: {
47+ // This can't be a simple binding because that would be triggered after this handler
48+ // while we need it active before doing the anition left/right
49+ priv.animateX = (inverseProgress == 0)
4750 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
4851 // left edge drag released. Minimum distance is given by design.
4952 if (priv.oldInverseProgress > units.gu(22)) {
@@ -92,6 +95,7 @@ Rectangle {
9295 property var focusedAppDelegate: null
9396
9497 property real oldInverseProgress: 0
98+ property bool animateX: true
9599
96100 onFocusedAppIdChanged: focusedAppDelegate = spreadRepeater.itemAt(0);
97101
@@ -311,7 +315,8 @@ Rectangle {
311315 Behavior on x {
312316 enabled: root.spreadEnabled &&
313317 !spreadView.active &&
314− !snapAnimation.running
318+ !snapAnimation.running &&
319+ priv.animateX
315320 UbuntuNumberAnimation {
316321 duration: UbuntuAnimation.FastDuration
317322 onRunningChanged: {
qml/Stages/TabletStage.qml+5
@@ -36,6 +36,9 @@ Rectangle {
3636 property real inverseProgress: 0 // This is the progress for left edge drags, in pixels.
3737
3838 onInverseProgressChanged: {
39+ // This can't be a simple binding because that would be triggered after this handler
40+ // while we need it active before doing the anition left/right
41+ spreadView.animateX = (inverseProgress == 0)
3942 if (inverseProgress == 0 && priv.oldInverseProgress > 0) {
4043 // left edge drag released. Minimum distance is given by design.
4144 if (priv.oldInverseProgress > units.gu(22)) {
@@ -193,6 +196,8 @@ Rectangle {
193196 property int draggedDelegateCount: 0
194197 property int closingIndex: -1
195198
199+ property bool animateX: true
200+
196201 property bool sideStageDragging: sideStageDragHandle.dragging
197202 property real sideStageDragProgress: sideStageDragHandle.progress
198203
qml/Stages/TransformedTabletSpreadDelegate.qml+2−1
@@ -138,7 +138,8 @@ SpreadDelegate {
138138 enabled: !spreadView.active &&
139139 !snapAnimation.running &&
140140 model.appId !== "unity8-dash" &&
141− !spreadView.sideStageDragging
141+ !spreadView.sideStageDragging &&
142+ spreadView.animateX
142143 UbuntuNumberAnimation {
143144 duration: UbuntuAnimation.FastDuration
144145 }