summaryrefslogtreecommitdiff
path: root/components/controls/StyledBusyIndicator.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-04 22:45:15 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-04 22:45:15 +1000
commitc5381c5194adf97c240acb98eb4c4c950633b325 (patch)
tree52b18eb1771ec6708c86f11d786684f03b8a7c48 /components/controls/StyledBusyIndicator.qml
parentdashboard: display correct temp units (diff)
downloadcaelestia-shell-c5381c5194adf97c240acb98eb4c4c950633b325.tar.gz
caelestia-shell-c5381c5194adf97c240acb98eb4c4c950633b325.tar.bz2
caelestia-shell-c5381c5194adf97c240acb98eb4c4c950633b325.zip
internal: refactor widgets folder
Split into subdirs and rename to components
Diffstat (limited to 'components/controls/StyledBusyIndicator.qml')
-rw-r--r--components/controls/StyledBusyIndicator.qml90
1 files changed, 90 insertions, 0 deletions
diff --git a/components/controls/StyledBusyIndicator.qml b/components/controls/StyledBusyIndicator.qml
new file mode 100644
index 0000000..060870f
--- /dev/null
+++ b/components/controls/StyledBusyIndicator.qml
@@ -0,0 +1,90 @@
+pragma ComponentBehavior: Bound
+
+import qs.services
+import qs.config
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Shapes
+
+BusyIndicator {
+ id: root
+
+ property color fgColour: Colours.palette.m3onPrimaryContainer
+ property color bgColour: Colours.palette.m3primaryContainer
+
+ background: null
+
+ contentItem: Shape {
+ id: shape
+
+ preferredRendererType: Shape.CurveRenderer
+ asynchronous: true
+
+ RotationAnimator on rotation {
+ from: 0
+ to: 180
+ running: root.visible && root.running
+ loops: Animation.Infinite
+ duration: Appearance.anim.durations.extraLarge
+ easing.type: Easing.Linear
+ easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
+ }
+
+ ShapePath {
+ strokeWidth: Math.min(root.implicitWidth, root.implicitHeight) * 0.18
+ strokeColor: root.bgColour
+ fillColor: "transparent"
+ capStyle: ShapePath.RoundCap
+
+ PathAngleArc {
+ centerX: shape.width / 2
+ centerY: shape.height / 2
+ radiusX: root.implicitWidth / 2
+ radiusY: root.implicitHeight / 2
+ startAngle: 0
+ sweepAngle: 360
+ }
+
+ Behavior on strokeColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+ }
+
+ ShapePath {
+ strokeWidth: Math.min(root.implicitWidth, root.implicitHeight) * 0.18
+ strokeColor: root.fgColour
+ fillColor: "transparent"
+ capStyle: ShapePath.RoundCap
+
+ PathAngleArc {
+ centerX: shape.width / 2
+ centerY: shape.height / 2
+ radiusX: root.implicitWidth / 2
+ radiusY: root.implicitHeight / 2
+ startAngle: -sweepAngle / 2
+ sweepAngle: 60
+ }
+
+ PathAngleArc {
+ centerX: shape.width / 2
+ centerY: shape.height / 2
+ radiusX: root.implicitWidth / 2
+ radiusY: root.implicitHeight / 2
+ startAngle: 180 - sweepAngle / 2
+ sweepAngle: 60
+ }
+
+ Behavior on strokeColor {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
+ }
+ }
+}