summaryrefslogtreecommitdiff
path: root/modules/dashboard/Media.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-28 15:44:28 +0800
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-28 15:44:28 +0800
commitcdc6776eeb4ad014dfa4f1a3a853744d1443a2d6 (patch)
treeb69bf0a12f00de988bb62a9d91cc54dcbf969789 /modules/dashboard/Media.qml
parentbar: crossfade active window title (diff)
downloadcaelestia-shell-cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6.tar.gz
caelestia-shell-cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6.tar.bz2
caelestia-shell-cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6.zip
dashboard: animate media visualiser colour
Diffstat (limited to 'modules/dashboard/Media.qml')
-rw-r--r--modules/dashboard/Media.qml13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/dashboard/Media.qml b/modules/dashboard/Media.qml
index 7b1bf2b..30c629a 100644
--- a/modules/dashboard/Media.qml
+++ b/modules/dashboard/Media.qml
@@ -62,10 +62,13 @@ Item {
readonly property real centerY: height / 2
readonly property real innerX: cover.implicitWidth / 2 + Appearance.spacing.small
readonly property real innerY: cover.implicitHeight / 2 + Appearance.spacing.small
+ property color colour: Colours.palette.m3primary
anchors.fill: cover
anchors.margins: -DashboardConfig.sizes.mediaVisualiserSize
+ onColourChanged: requestPaint()
+
onPaint: {
const ctx = getContext("2d");
ctx.reset();
@@ -73,7 +76,7 @@ Item {
const values = root.cava;
const len = values.length;
- ctx.strokeStyle = Colours.palette.m3primary;
+ ctx.strokeStyle = colour;
ctx.lineWidth = 360 / len - Appearance.spacing.small / 4;
ctx.lineCap = "round";
@@ -97,6 +100,14 @@ Item {
ctx.stroke();
}
+
+ Behavior on colour {
+ ColorAnimation {
+ duration: Appearance.anim.durations.normal
+ easing.type: Easing.BezierSpline
+ easing.bezierCurve: Appearance.anim.curves.standard
+ }
+ }
}
StyledClippingRect {