10import QtQuick.Templates as T
11import org.kde.kirigami as Kirigami
12import org.kde.ksvg as KSvg
14import org.kde.plasma.core as PlasmaCore
19 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
20 implicitContentWidth + leftPadding + rightPadding)
21 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
22 implicitContentHeight + topPadding + bottomPadding)
38 readonly property bool animationShouldBeRunning:
40 && Window.visibility !== Window.Hidden
41 && Kirigami.Units.longDuration > 1
46 implicitWidth: Kirigami.Units.gridUnit * 2
47 implicitHeight: Kirigami.Units.gridUnit * 2
50 visible: control.running || opacityAnimator.running
51 opacity: control.running ? 1 : 0
53 enabled: Kirigami.Units.shortDuration > 0
56 duration: Kirigami.Units.shortDuration
57 easing.type: Easing.OutCubic
62 onAnimationShouldBeRunningChanged: startOrStopAnimation();
64 function startOrStopAnimation() {
65 if (rotationAnimator.running === animationShouldBeRunning) {
68 if (animationShouldBeRunning) {
69 const date =
new Date;
70 const ms = date.valueOf();
71 const startAngle = ((ms % rotationAnimator.duration) / rotationAnimator.duration) * 360;
72 rotationAnimator.from = startAngle;
73 rotationAnimator.to = startAngle + 360
75 rotationAnimator.running = animationShouldBeRunning;
82 anchors.centerIn: parent
83 width: Math.min(parent.width, parent.height)
86 imagePath:
"widgets/busywidget"
87 elementId:
"busywidget"
89 RotationAnimator on rotation {
97 loops: Animation.Infinite
107 Component.onCompleted: startOrStopAnimation();