diff options
author | Martin Jones <martin.jones@nokia.com> | 2012-03-14 16:56:46 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-15 04:22:43 +0100 |
commit | d7f2a77f2b236de6b08b4c8905722280d9c44541 (patch) | |
tree | 362216c53ee35a8713789401074b53984bdd6add /src | |
parent | 25793276e52240e4dfad297dc5b9eb282ed3f5e6 (diff) |
Set more sensible Flickable default input filtering parameters
Shouldn't throw anything away by default. Also fix bug that
flicking back into bounds from outside bounds halved velocity.
Change-Id: I3c2d303a9e46910439dc8bfb01771376f634a684
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickflickable.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 2447fd6ed1..b6d3ebd7f2 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE // The number of samples to discard when calculating the flick velocity. // Touch panels often produce inaccurate results as the finger is lifted. #ifndef QML_FLICK_DISCARDSAMPLES -#define QML_FLICK_DISCARDSAMPLES 1 +#define QML_FLICK_DISCARDSAMPLES 0 #endif // The default maximum velocity of a flick. @@ -103,7 +103,7 @@ QT_BEGIN_NAMESPACE // FlickThreshold determines how far the "mouse" must have moved // before we perform a flick. -static const int FlickThreshold = 20; +static const int FlickThreshold = 15; // RetainGrabVelocity is the maxmimum instantaneous velocity that // will ensure the Flickable retains the grab on consecutive flicks. @@ -1030,7 +1030,7 @@ void QQuickFlickablePrivate::handleMouseReleaseEvent(QMouseEvent *event) vVelocity = (extended && extended->capabilities().testFlag(QTouchDevice::Velocity)) ? extended->velocity().y() : vData.velocity; } - if (vData.atBeginning || vData.atEnd) { + if ((vData.atBeginning && vVelocity > 0.) || (vData.atEnd && vVelocity < 0.)) { vVelocity /= 2; } else if (vData.continuousFlickVelocity != 0.0 && vData.viewSize/q->height() > QML_FLICK_MULTIFLICK_RATIO @@ -1046,7 +1046,7 @@ void QQuickFlickablePrivate::handleMouseReleaseEvent(QMouseEvent *event) hVelocity = (extended && extended->capabilities().testFlag(QTouchDevice::Velocity)) ? extended->velocity().x() : hData.velocity; } - if (hData.atBeginning || hData.atEnd) { + if ((hData.atBeginning && hVelocity > 0.) || (hData.atEnd && hVelocity < 0.)) { hVelocity /= 2; } else if (hData.continuousFlickVelocity != 0.0 && hData.viewSize/q->width() > QML_FLICK_MULTIFLICK_RATIO |