aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-11-08 16:08:56 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-12-19 10:48:29 +0000
commit44382ff104965c5596b5138aa84e0e4ccf178772 (patch)
treea06372db6d0ff7f62f56f2aceb8b80628aa6b0c3 /src
parentf5c13e141c9c9bf7b131da6948ebcfc01d82f160 (diff)
SwipeView: fix slow swiping in large views
Flickable has a default maximumFlickVelocity of 2500 regardless of its size. When SwipeView covers the whole screen and ends up being large, 2500 pixels per second is nowhere near enough. Calculate a suitable maximum flick velocity based on the size of the view. Task-number: QTBUG-62110 Change-Id: Iaf26f586f99e7635ea931a4e3060ad4dd480a011 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/controls/SwipeView.qml1
-rw-r--r--src/imports/controls/material/SwipeView.qml1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/imports/controls/SwipeView.qml b/src/imports/controls/SwipeView.qml
index 4ccef22b..9f2d9ccb 100644
--- a/src/imports/controls/SwipeView.qml
+++ b/src/imports/controls/SwipeView.qml
@@ -60,5 +60,6 @@ T.SwipeView {
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 250
+ maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height)
}
}
diff --git a/src/imports/controls/material/SwipeView.qml b/src/imports/controls/material/SwipeView.qml
index 293cce46..64ecb00f 100644
--- a/src/imports/controls/material/SwipeView.qml
+++ b/src/imports/controls/material/SwipeView.qml
@@ -59,5 +59,6 @@ T.SwipeView {
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 250
+ maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height)
}
}