on xenial help sign in
Only animate the dash overview drag after the gesture has been recognized
963005eDaniel d'Andrada
qml/Dash/Dash.qml+23−7
@@ -364,16 +364,32 @@ Showable {
364 height: units.gu(2)
364 height: units.gu(2)
365
365
366 onSceneDistanceChanged: {
366 onSceneDistanceChanged: {
367+ if (status == DirectionalDragArea.Recognized && initialSceneDistance != -1) {
367− if (overviewController.enableAnimation) {
368+ if (overviewController.enableAnimation) {
368− dashContentCache.scheduleUpdate();
369+ dashContentCache.scheduleUpdate();
370+ }
371+ overviewController.enableAnimation = false;
372+ var deltaDistance = sceneDistance - initialSceneDistance;
373+ overviewController.progress = Math.max(0, Math.min(1, deltaDistance / fullMovement));
369 }
374 }
370− overviewController.enableAnimation = false;
371− overviewController.progress = Math.max(0, Math.min(1, sceneDistance / fullMovement));
372 }
375 }
373
376
374− onDraggingChanged: {
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) {
375− overviewController.enableAnimation = true;
389+ overviewController.enableAnimation = true;
376− overviewController.progress = (overviewController.progress > 0.7) ? 1 : 0;
390+ overviewController.progress = (overviewController.progress > 0.7) ? 1 : 0;
391+ initialSceneDistance = -1;
392+ }
377 }
393 }
378 }
394 }
379
395