Changeset View
Changeset View
Standalone View
Standalone View
src/controls/templates/private/ScrollView.qml
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 76 | onContentItemChanged: { | |||
---|---|---|---|---|---|
84 | } else { | 84 | } else { | ||
85 | flickableItem = flickableComponent.createObject(flickableParent); | 85 | flickableItem = flickableComponent.createObject(flickableParent); | ||
86 | contentItem.parent = flickableItem.contentItem; | 86 | contentItem.parent = flickableItem.contentItem; | ||
87 | } | 87 | } | ||
88 | //TODO: find a way to make flicking work on laptops with touch screen | 88 | //TODO: find a way to make flicking work on laptops with touch screen | ||
89 | flickableItem.interactive = Settings.isMobile || root.alwaysInteractive; | 89 | flickableItem.interactive = Settings.isMobile || root.alwaysInteractive; | ||
90 | flickableItem.anchors.fill = flickableParent; | 90 | flickableItem.anchors.fill = flickableParent; | ||
91 | flickableItem.ScrollBar.vertical = scrollComponent.createObject(root); | 91 | flickableItem.ScrollBar.vertical = scrollComponent.createObject(root); | ||
92 | flickableItem.ScrollBar.vertical.anchors.right = root.right | | |||
93 | flickableItem.ScrollBar.vertical.anchors.top = root.top | | |||
94 | //flickableItem.ScrollBar.vertical.anchors.bottom = root.bottom | | |||
95 | } | 92 | } | ||
96 | 93 | | |||
97 | //NOTE: use this instead of anchors as crashes on some Qt 5.8 checkouts | | |||
98 | onHeightChanged: flickableItem.ScrollBar.vertical.height = root.height | | |||
99 | MultiPointTouchArea { | 94 | MultiPointTouchArea { | ||
100 | id: flickableParent | 95 | id: flickableParent | ||
101 | anchors { | 96 | anchors { | ||
102 | fill: parent | 97 | fill: parent | ||
103 | } | 98 | } | ||
104 | clip: true | 99 | clip: true | ||
105 | mouseEnabled: false | 100 | mouseEnabled: false | ||
106 | maximumTouchPoints: 1 | 101 | maximumTouchPoints: 1 | ||
Show All 15 Lines | 112 | Flickable { | |||
122 | contentHeight: root.contentItem ? root.contentItem.height : 0 | 117 | contentHeight: root.contentItem ? root.contentItem.height : 0 | ||
123 | } | 118 | } | ||
124 | } | 119 | } | ||
125 | Component { | 120 | Component { | ||
126 | id: scrollComponent | 121 | id: scrollComponent | ||
127 | ScrollBar { | 122 | ScrollBar { | ||
128 | z: flickableParent.z + 1 | 123 | z: flickableParent.z + 1 | ||
129 | visible: root.contentItem.visible && size < 1 | 124 | visible: root.contentItem.visible && size < 1 | ||
125 | | ||||
126 | //NOTE: use this instead of anchors as crashes on some Qt 5.8 checkouts | ||||
127 | height: parent.height - anchors.topMargin | ||||
128 | anchors { | ||||
129 | topMargin: parent.flickableItem.headerItem ? parent.flickableItem.headerItem.height : 0 | ||||
130 | right: parent.right | ||||
131 | top: parent.top | ||||
132 | } | ||||
130 | } | 133 | } | ||
131 | } | 134 | } | ||
132 | } | 135 | } |