21 import QtQuick.Controls 1.3 as Controls
22 import QtGraphicalEffects 1.0
23 import QtQuick.Layouts 1.2
24 import org.kde.kirigami 1.0
74 property bool refreshing:
false
80 property bool supportsRefreshing:
false
111 id: busyIndicatorFrame
113 y: -root.flickableItem.contentY-height
114 width: root.flickableItem.width
116 Controls.BusyIndicator {
118 anchors.centerIn: parent
119 running: root.refreshing
120 visible: root.refreshing
130 visible: supportsRefreshing && !refreshing && progress > 0
133 border.color:
Theme.viewBackgroundColor
135 property real progress: supportsRefreshing && !refreshing ? (parent.y/busyIndicatorFrame.height) : 0
139 source: spinnerProgress
140 visible: spinnerProgress.visible
141 anchors.fill: spinnerProgress
143 GradientStop { position: 0.00; color:
Theme.highlightColor }
144 GradientStop { position: spinnerProgress.progress; color:
Theme.highlightColor }
145 GradientStop { position: spinnerProgress.progress + 0.01; color:
"transparent" }
146 GradientStop { position: 1.00; color:
"transparent" }
151 if (y > busyIndicatorFrame.height*1.5 + topPadding && applicationWindow() && root.flickableItem.atYBeginning && applicationWindow().pageStack.anchors.bottomMargin == 0 && root.width < root.height) {
152 applicationWindow().reachableMode =
true;
153 overshootResetTimer.restart();
156 if (!supportsRefreshing) {
159 if (!root.refreshing && y > busyIndicatorFrame.height/2 + topPadding) {
160 root.refreshing =
true;
164 id: overshootResetTimer
167 applicationWindow().reachableMode =
false;
171 target: root.flickableItem
172 property:
"topMargin"
173 value: applicationWindow().wideScreen ? 0 : Math.max(root.topPadding + (root.refreshing ? busyIndicatorFrame.height : 0), applicationWindow().header.height)
177 target: root.flickableItem
178 property:
"flickableDirection"
179 value: Flickable.VerticalFlick
183 target: root.flickableItem
184 property:
"bottomMargin"
189 target: root.contentItem
191 value: root.flickableItem.width
199 if (applicationWindow() && applicationWindow().header && !applicationWindow().wideScreen) {
200 flickableItem.contentY = -applicationWindow().header.preferredHeight;
203 if (root.contentItem == root.flickableItem) {
204 flickableItem.anchors.leftMargin = 0;
205 flickableItem.anchors.topMargin = 0;
206 flickableItem.anchors.rightMargin = 0;
207 flickableItem.anchors.bottomMargin = 0;
209 flickableItem.anchors.leftMargin = leftPadding;
210 flickableItem.anchors.topMargin = topPadding;
211 flickableItem.anchors.rightMargin = rightPadding;
212 flickableItem.anchors.bottomMargin = bottomPadding;
220 if (!applicationWindow() || !applicationWindow().activeFocusItem) {
226 var isDescendent =
false;
227 var candidate = applicationWindow().activeFocusItem.parent;
229 if (candidate == root) {
233 candidate = candidate.parent;
240 if (applicationWindow().activeFocusItem.cursorPosition !== undefined) {
241 cursorY = applicationWindow().activeFocusItem.positionToRectangle(applicationWindow().activeFocusItem.cursorPosition).y;
244 var pos = applicationWindow().activeFocusItem.mapToItem(root.contentItem, 0, cursorY);
247 if (pos.y >= root.flickableItem.contentY && pos.y <= root.flickableItem.contentY + root.flickableItem.height -
Units.
gridUnit * 8) {
250 root.flickableItem.contentY = pos.y;
253 onLeftPaddingChanged: {
254 if (root.contentItem == root.flickableItem) {
255 flickableItem.anchors.leftMargin = 0;
256 flickableItem.anchors.topMargin = 0;
257 flickableItem.anchors.rightMargin = 0;
258 flickableItem.anchors.bottomMargin = 0;
260 flickableItem.anchors.leftMargin = leftPadding;
261 flickableItem.anchors.topMargin = topPadding;
262 flickableItem.anchors.rightMargin = rightPadding;
263 flickableItem.anchors.bottomMargin = bottomPadding;
267 onFlickableItemChanged: resetTimer.restart()
int smallSpacing
units.smallSpacing is the amount of spacing that should be used around smaller UI elements...
int gridUnit
The fundamental unit of space that should be used for sizes, expressed in pixels. ...