Changeset View
Changeset View
Standalone View
Standalone View
src/controls/templates/private/ScrollView.qml
Show All 40 Lines | 40 | onHorizontalScrollBarPolicyChanged: { | |||
---|---|---|---|---|---|
41 | if (flickableItem.ScrollBar.horizontal) { | 41 | if (flickableItem.ScrollBar.horizontal) { | ||
42 | flickableItem.ScrollBar.horizontal.visible = horizontalScrollBarPolicy != Qt.ScrollBarAlwaysOff; | 42 | flickableItem.ScrollBar.horizontal.visible = horizontalScrollBarPolicy != Qt.ScrollBarAlwaysOff; | ||
43 | } | 43 | } | ||
44 | scrollBarCreationTimer.restart(); | 44 | scrollBarCreationTimer.restart(); | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | drag.filterChildren: !Settings.isMobile | 47 | drag.filterChildren: !Settings.isMobile | ||
48 | onPressed: { | 48 | onPressed: { | ||
49 | if (Settings.isMobile) { | ||||
50 | return; | ||||
51 | } | ||||
49 | mouse.accepted = false; | 52 | mouse.accepted = false; | ||
50 | flickableItem.interactive = true; | 53 | flickableItem.interactive = true; | ||
51 | } | 54 | } | ||
52 | onReleased: { | 55 | onReleased: { | ||
56 | if (Settings.isMobile) { | ||||
57 | return; | ||||
58 | } | ||||
53 | mouse.accepted = false; | 59 | mouse.accepted = false; | ||
54 | flickableItem.interactive = false; | 60 | flickableItem.interactive = false; | ||
55 | } | 61 | } | ||
56 | onWheel: { | 62 | onWheel: { | ||
57 | flickableItem.interactive = false; | | |||
58 | if (Settings.isMobile || flickableItem.contentHeight<flickableItem.height) { | 63 | if (Settings.isMobile || flickableItem.contentHeight<flickableItem.height) { | ||
59 | return; | 64 | return; | ||
60 | } | 65 | } | ||
66 | | ||||
67 | flickableItem.interactive = false; | ||||
61 | var y = wheel.pixelDelta.y != 0 ? wheel.pixelDelta.y : wheel.angleDelta.y / 8; | 68 | var y = wheel.pixelDelta.y != 0 ? wheel.pixelDelta.y : wheel.angleDelta.y / 8; | ||
62 | 69 | | |||
63 | //if we don't have a pixeldelta, apply the configured mouse wheel lines | 70 | //if we don't have a pixeldelta, apply the configured mouse wheel lines | ||
64 | if (!wheel.pixelDelta.y) { | 71 | if (!wheel.pixelDelta.y) { | ||
65 | y *= Settings.mouseWheelScrollLines; | 72 | y *= Settings.mouseWheelScrollLines; | ||
66 | } | 73 | } | ||
67 | 74 | | |||
68 | // Scroll one page regardless of delta: | 75 | // Scroll one page regardless of delta: | ||
Show All 11 Lines | |||||
80 | flickableItem.contentY = Math.min(-maxYExtent, Math.max(-minYExtent, flickableItem.contentY - y)); | 87 | flickableItem.contentY = Math.min(-maxYExtent, Math.max(-minYExtent, flickableItem.contentY - y)); | ||
81 | 88 | | |||
82 | //this is just for making the scrollbar appear | 89 | //this is just for making the scrollbar appear | ||
83 | flickableItem.flick(0, 0); | 90 | flickableItem.flick(0, 0); | ||
84 | flickableItem.cancelFlick(); | 91 | flickableItem.cancelFlick(); | ||
85 | } | 92 | } | ||
86 | Connections { | 93 | Connections { | ||
87 | target: flickableItem | 94 | target: flickableItem | ||
95 | enabled: !Settings.isMobile | ||||
88 | onFlickEnded: flickableItem.interactive = false; | 96 | onFlickEnded: flickableItem.interactive = false; | ||
89 | onMovementEnded: flickableItem.interactive = false; | 97 | onMovementEnded: flickableItem.interactive = false; | ||
90 | } | 98 | } | ||
91 | 99 | | |||
92 | onContentItemChanged: { | 100 | onContentItemChanged: { | ||
93 | if (contentItem.hasOwnProperty("contentY")) { | 101 | if (contentItem.hasOwnProperty("contentY")) { | ||
94 | flickableItem = contentItem; | 102 | flickableItem = contentItem; | ||
95 | if (typeof(flickableItem.keyNavigationEnabled) != "undefined") { | 103 | if (typeof(flickableItem.keyNavigationEnabled) != "undefined") { | ||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |