summaryrefslogtreecommitdiffstats
path: root/framework/qml
diff options
context:
space:
mode:
Diffstat (limited to 'framework/qml')
-rw-r--r--framework/qml/ConversationView.qml8
-rw-r--r--framework/qml/ListView.qml51
2 files changed, 53 insertions, 6 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml
index 2f499752..9c21b470 100644
--- a/framework/qml/ConversationView.qml
+++ b/framework/qml/ConversationView.qml
@@ -1,5 +1,6 @@
1/* 1/*
2 * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net> 2 * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsystems.com>
3 * 4 *
4 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
@@ -59,7 +60,7 @@ Rectangle {
59 60
60 color: Kube.Colors.backgroundColor 61 color: Kube.Colors.backgroundColor
61 62
62 ListView { 63 Kube.ListView {
63 id: listView 64 id: listView
64 65
65 anchors.fill: parent 66 anchors.fill: parent
@@ -110,11 +111,6 @@ Rectangle {
110 //Setting the currentIndex results in further lags. So we don't do that either. 111 //Setting the currentIndex results in further lags. So we don't do that either.
111 // currentIndex: root.currentIndex 112 // currentIndex: root.currentIndex
112 113
113 boundsBehavior: Flickable.StopAtBounds
114
115 //default is 1500, which is not usable with a mouse
116 flickDeceleration: 1500
117
118 //Optimize for view quality 114 //Optimize for view quality
119 pixelAligned: true 115 pixelAligned: true
120 116
diff --git a/framework/qml/ListView.qml b/framework/qml/ListView.qml
new file mode 100644
index 00000000..7fbb5721
--- /dev/null
+++ b/framework/qml/ListView.qml
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2016 Michael Bohlender, <michael.bohlender@kdemail.net>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsystems.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick 2.7
21import QtQuick.Controls 2
22
23ListView {
24 id: root
25 property var focusProxy: root
26
27 /*
28 * The MouseArea + interactive: false + maximumFlickVelocity are required
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
37 propagateComposedEvents: true
38
39 onWheel: {
40 //Some trackpads (mine) emit 0 events in between that we can safely ignore.
41 if (wheel.angleDelta.y) {
42 listView.flick(0, wheel.angleDelta.y * 40)
43 }
44 }
45 }
46 interactive: false
47 maximumFlickVelocity: 100000
48
49 boundsBehavior: Flickable.StopAtBounds
50}
51