From 04d946e786700a06c017d26c3b0c7762f6d70e72 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 5 Aug 2015 14:47:44 +0200 Subject: [PATCH] adjust flick velocity&deceleration to dpi on denser screens we need more higher speed and deceleration expressed in pixels Change-Id: Ida366190ec99720f05b8c52f08514fc087a67948 reviewed-by: "Kai Uwe Broulik" --- .../plasmastyle/ScrollViewStyle.qml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/declarativeimports/plasmastyle/ScrollViewStyle.qml b/src/declarativeimports/plasmastyle/ScrollViewStyle.qml index 697888db7..12925e6bf 100644 --- a/src/declarativeimports/plasmastyle/ScrollViewStyle.qml +++ b/src/declarativeimports/plasmastyle/ScrollViewStyle.qml @@ -31,6 +31,26 @@ QtQuickControlStyle.ScrollViewStyle { transientScrollBars: false + function syncVelocity() { + if (!control.flickableItem) { + return; + } + + // QTBUG-35608 + // default values are hardcoded in qtdeclarative/src/quick/items/qquickflickablebehavior_p.h + control.flickableItem.flickDeceleration = Math.round(1500 * units.devicePixelRatio); + // double maximum speed so it feels better + control.flickableItem.maximumFlickVelocity = Math.round(2500 * units.devicePixelRatio); + + control.flickableItem.interactive = true; + } + + Component.onCompleted: syncVelocity() + Connections { + target: control + onContentItemChanged: syncVelocity() + } + frame: Item { PlasmaCore.Svg { id: borderSvg