2023-05-31 19:28:09 -04:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls
|
|
|
|
import QtQuick.Controls.Basic
|
|
|
|
|
|
|
|
BusyIndicator {
|
|
|
|
id: control
|
|
|
|
|
2024-06-24 18:49:23 -04:00
|
|
|
property real size: 48
|
|
|
|
property color color: theme.accentColor
|
|
|
|
|
2023-05-31 19:28:09 -04:00
|
|
|
contentItem: Item {
|
2024-06-24 18:49:23 -04:00
|
|
|
implicitWidth: control.size
|
|
|
|
implicitHeight: control.size
|
2023-05-31 19:28:09 -04:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: item
|
2023-06-01 17:23:45 -04:00
|
|
|
x: parent.width / 2 - width / 2
|
|
|
|
y: parent.height / 2 - height / 2
|
2024-06-24 18:49:23 -04:00
|
|
|
width: control.size
|
|
|
|
height: control.size
|
2023-05-31 19:28:09 -04:00
|
|
|
opacity: control.running ? 1 : 0
|
|
|
|
|
|
|
|
Behavior on opacity {
|
|
|
|
OpacityAnimator {
|
|
|
|
duration: 250
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RotationAnimator {
|
|
|
|
target: item
|
|
|
|
running: control.visible && control.running
|
|
|
|
from: 0
|
|
|
|
to: 360
|
|
|
|
loops: Animation.Infinite
|
|
|
|
duration: 1750
|
|
|
|
}
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: repeater
|
|
|
|
model: 6
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: delegate
|
|
|
|
x: item.width / 2 - width / 2
|
|
|
|
y: item.height / 2 - height / 2
|
2024-06-24 18:49:23 -04:00
|
|
|
implicitWidth: control.size * .2
|
|
|
|
implicitHeight: control.size * .2
|
|
|
|
radius: control.size * .1
|
|
|
|
color: control.color
|
2023-05-31 19:28:09 -04:00
|
|
|
|
|
|
|
required property int index
|
|
|
|
|
|
|
|
transform: [
|
|
|
|
Translate {
|
2024-06-24 18:49:23 -04:00
|
|
|
y: -Math.min(item.width, item.height) * 0.5 + delegate.radius
|
2023-05-31 19:28:09 -04:00
|
|
|
},
|
|
|
|
Rotation {
|
|
|
|
angle: delegate.index / repeater.count * 360
|
2024-06-24 18:49:23 -04:00
|
|
|
origin.x: delegate.radius
|
|
|
|
origin.y: delegate.radius
|
2023-05-31 19:28:09 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|