diff options
author | Martin Jones <[email protected]> | 2012-03-09 15:40:29 +1000 |
---|---|---|
committer | Qt by Nokia <[email protected]> | 2012-03-13 02:02:49 +0100 |
commit | fb1ce5ed0dc037ba6cd66b34321a43a82de6bd0e (patch) | |
tree | 881094cd0c44ea5132c71dfcc0fe7eb11a9e1d5e /src/quick/items/qquickpathview.cpp | |
parent | c4e25d2cf6fe49277a37e183504990535242037f (diff) |
Improve interaction of nested Flickables and PathView
Don't require a flick to come to a complete stop before
allowing another flickable element to begin its
gesture.
Change-Id: I74c1998e01e04c70c76253cd09edc02f593123d0
Reviewed-by: Michael Brasser <[email protected]>
Diffstat (limited to 'src/quick/items/qquickpathview.cpp')
-rw-r--r-- | src/quick/items/qquickpathview.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp index f8098c8f65..0526187531 100644 --- a/src/quick/items/qquickpathview.cpp +++ b/src/quick/items/qquickpathview.cpp @@ -1224,7 +1224,8 @@ void QQuickPathViewPrivate::handleMousePressEvent(QMouseEvent *event) return; } - if (tl.isActive() && flicking) + + if (tl.isActive() && flicking && flickDuration && qreal(tl.time())/flickDuration < 0.8) stealMouse = true; // If we've been flicked then steal the click. else stealMouse = false; @@ -1335,6 +1336,7 @@ void QQuickPathViewPrivate::handleMouseReleaseEvent(QMouseEvent *) } else { dist = qMin(qreal(modelCount-1), qreal(v2 / (accel * 2.0))); } + flickDuration = static_cast<int>(1000 * qAbs(velocity) / accel); offsetAdj = 0.0; moveOffset.setValue(offset); tl.accel(moveOffset, velocity, accel, dist); |