on xenial help sign in
Only animate the dash overview drag after the gesture has been recognized
commit963005ee25777c4eb6064091823315e078bc87fa authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateFri 3 Oct 2014, 15:09 (12 years ago) parent3820313
1 file changed+23−7
qml/Dash/Dash.qml+23−7
qml/Dash/Dash.qml+23−7
@@ -364,16 +364,32 @@ Showable {
364364 height: units.gu(2)
365365
366366 onSceneDistanceChanged: {
367− if (overviewController.enableAnimation) {
368− dashContentCache.scheduleUpdate();
367+ if (status == DirectionalDragArea.Recognized && initialSceneDistance != -1) {
368+ if (overviewController.enableAnimation) {
369+ dashContentCache.scheduleUpdate();
370+ }
371+ overviewController.enableAnimation = false;
372+ var deltaDistance = sceneDistance - initialSceneDistance;
373+ overviewController.progress = Math.max(0, Math.min(1, deltaDistance / fullMovement));
369374 }
370− overviewController.enableAnimation = false;
371− overviewController.progress = Math.max(0, Math.min(1, sceneDistance / fullMovement));
372375 }
373376
374− onDraggingChanged: {
375− overviewController.enableAnimation = true;
376− overviewController.progress = (overviewController.progress > 0.7) ? 1 : 0;
377+ property int previousStatus: -1
378+ property int currentStatus: DirectionalDragArea.WaitingForTouch
379+ property real initialSceneDistance: -1
380+
381+ onStatusChanged: {
382+ previousStatus = currentStatus;
383+ currentStatus = status;
384+
385+ if (status == DirectionalDragArea.Recognized) {
386+ initialSceneDistance = sceneDistance;
387+ } else if (status == DirectionalDragArea.WaitingForTouch &&
388+ previousStatus == DirectionalDragArea.Recognized) {
389+ overviewController.enableAnimation = true;
390+ overviewController.progress = (overviewController.progress > 0.7) ? 1 : 0;
391+ initialSceneDistance = -1;
392+ }
377393 }
378394 }
379395