8import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
10import QtQuick.Shapes as QQShapes
24 property Flickable flickable: {
25 let candidate = parent
27 if (candidate instanceof Flickable) {
29 } else if (candidate instanceof Kirigami.ScrollablePage) {
30 return candidate.flickable
32 candidate = candidate.parent
45 property bool active:
false
50 readonly
property real progress: !refreshing ? Math.min(-Math.min(flickable?.verticalOvershoot ?? 0, 0) / indicatorContainer.height, 1) : 0
58 property int refreshDelay: 500
67 id: indicatorContainer
68 parent: root.flickable
70 bottom: parent?.contentItem?.top
71 bottomMargin: root.flickable.topMargin
74 width: flickable?.width
75 height: Kirigami.Units.gridUnit * 4
79 anchors.centerIn: parent
88 margins: Kirigami.Units.smallSpacing
90 visible: !root.active && root.progress > 0
92 strokeWidth: Kirigami.Units.smallSpacing
93 strokeColor: Kirigami.Theme.highlightColor
94 fillColor:
"transparent"
96 centerX: spinnerProgress.width / 2
97 centerY: spinnerProgress.height / 2
98 radiusX: spinnerProgress.width / 2 - Kirigami.Units.smallSpacing / 2
99 radiusY: spinnerProgress.height / 2 - Kirigami.Units.smallSpacing / 2
101 sweepAngle: 360 * root.progress
108 if (!root.active && root.progress >= 1) {
109 refreshTriggerTimer.running =
true;
111 refreshTriggerTimer.running =
false;
121 target: indicatorContainer
122 anchors.bottomMargin: root.flickable.topMargin - indicatorContainer.height
125 target: root.flickable
132 topMargin: indicatorContainer.height + root.flickable.topMargin
141 enabled: root.flickable.verticalOvershoot >= 0
144 target: root.flickable
146 easing.type: Easing.InOutQuad
147 duration: Kirigami.Units.longDuration
153 id: refreshTriggerTimer
154 interval: root.refreshDelay
156 if (!root.active && root.progress >= 1) {
QString name(StandardAction id)