~unity-team/unity8/trunk

« back to all changes in this revision

Viewing changes to qml/Dash/Dash.qml

  • Committer: CI Train Bot
  • Author(s): Daniel d'Andrada
  • Date: 2015-05-05 14:46:02 UTC
  • mfrom: (1709.5.8 ddaImprovements)
  • Revision ID: ci-train-bot@canonical.com-20150505144602-7bhwyodam4vac3qk
DirectionalDragArea: improvements & API grooming

-Simplified DirectionalDragArea gesture recognition
 * The widening angle property was dropped. Didn't really work
   as in real life swipes might start up in very different directions
   before finally turning to the final overall direction. That's specially
   bad when you have to conclude the recognition in a short amount
   of time so that you can still play animations to follow the user's finger
 * minSpeed as well. Went for a simpler way of expressing and evaluating it
   which is having maxTime and maxDistance.

-EdgeDragArea got absorbed by DirectionalDragArea

-Privatized all gesture recognition parameters.

-Privatized DirectionalDragArea.status property. All apps need is
 DirectionalDragArea.dragging. Modified qml code using DDA accordingly.

-Modified DirectionalDragArea.dragging semantics a bit. It goes to true only
 once a gesture is recognized

-Moved code that smooths out touch movement into DirectionalDragArea so all users
 get it for free.

-Cleaned up DirectionalDragArea.h of all implementation details, getting it ready
 to be moved out of unity8, into the SDK.

-Removed DirectionalDragArea.tapped() signal as it doesn't belong to it.

-Fine-tuned gesture recognition parameters and made them based on physical size.

-Added tests with input from real gestures to catch those annoying
  false-negatives and false-positives introduced by badly set recognition parameters

-Improved debug output

-UnownedTouchEvents are no longer sent to interim owners

-Fixed issue when TouchGate got disabled while holding an active touch

-Made "make tryDirectionalDragArea" and "make tryDragHandle" work with mouse again. Fixes: #1417920
Approved by: Michael Zanetti, Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
        // (as expected) but would also cause the dash content flickable to move a bit, because
154
154
        // that flickable was getting the touch events while overviewDragHandle was still undecided
155
155
        // about whether that touch was indeed performing a directional drag gesture.
156
 
        forceNonInteractive: overviewDragHandle.status != DirectionalDragArea.WaitingForTouch
 
156
        forceNonInteractive: overviewDragHandle.dragging
157
157
 
158
158
        enabled: bottomEdgeController.progress == 0
159
159
    }
330
330
        }
331
331
    }
332
332
 
333
 
    EdgeDragArea {
 
333
    DirectionalDragArea {
334
334
        id: overviewDragHandle
335
335
        objectName: "overviewDragHandle"
336
336
        z: 1
346
346
        height: units.gu(2)
347
347
 
348
348
        onSceneDistanceChanged: {
349
 
            if (status == DirectionalDragArea.Recognized) {
 
349
            if (dragging) {
350
350
                bottomEdgeController.enableAnimation = false;
351
351
                bottomEdgeController.progress = Math.max(0, Math.min(1, sceneDistance / fullMovement));
352
352
            }
353
353
        }
354
354
 
355
 
        property int previousStatus: -1
356
 
        property int currentStatus: DirectionalDragArea.WaitingForTouch
357
 
 
358
 
        onStatusChanged: {
359
 
            previousStatus = currentStatus;
360
 
            currentStatus = status;
361
 
 
362
 
            if (status == DirectionalDragArea.WaitingForTouch &&
363
 
                    previousStatus == DirectionalDragArea.Recognized) {
 
355
        onDraggingChanged: {
 
356
            if (!dragging) {
364
357
                bottomEdgeController.enableAnimation = true;
365
358
                bottomEdgeController.progress = (bottomEdgeController.progress > 0.2)  ? 1 : 0;
366
359
            }