summaryrefslogtreecommitdiffstats
path: root/framework/qml/ListView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml/ListView.qml')
-rw-r--r--framework/qml/ListView.qml29
1 files changed, 3 insertions, 26 deletions
diff --git a/framework/qml/ListView.qml b/framework/qml/ListView.qml
index f137d03e..161fe48e 100644
--- a/framework/qml/ListView.qml
+++ b/framework/qml/ListView.qml
@@ -19,37 +19,14 @@
19 19
20import QtQuick 2.7 20import QtQuick 2.7
21import QtQuick.Controls 2 21import QtQuick.Controls 2
22import org.kube.framework 1.0 as Kube
22 23
23ListView { 24ListView {
24 id: root 25 id: root
25 property var focusProxy: root
26 26
27 /* 27 Kube.ScrollHelper {
28 * The MouseArea + interactive: false + maximumFlickVelocity are required 28 flickable: root
29 * to fix scrolling for desktop systems where we don't want flicking behaviour.
30 *
31 * See also:
32 * ScrollView.qml in qtquickcontrols
33 * qquickwheelarea.cpp in qtquickcontrols
34 */
35 MouseArea {
36 anchors.fill: root 29 anchors.fill: root
37 propagateComposedEvents: true
38
39 onWheel: {
40 //Some trackpads (mine) emit 0 events in between that we can safely ignore.
41 if (wheel.pixelDelta.y) {
42 //120 is apparently the factor used in windows(https://chromium.googlesource.com/chromium/src/+/70763eb93a32555910a3b4269aeec51252ab9ec6/ui/events/event.cc)
43 listView.flick(0, wheel.pixelDelta.y * 120)
44 } else if (wheel.angleDelta.y) {
45 //Arbitrary but this seems to work for me...
46 listView.flick(0, wheel.angleDelta.y * 10)
47 }
48 }
49 } 30 }
50 interactive: false
51 maximumFlickVelocity: 100000
52
53 boundsBehavior: Flickable.StopAtBounds
54} 31}
55 32