diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-28 15:44:28 +0800 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-28 15:44:28 +0800 |
| commit | cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6 (patch) | |
| tree | b69bf0a12f00de988bb62a9d91cc54dcbf969789 /modules | |
| parent | bar: crossfade active window title (diff) | |
| download | caelestia-shell-cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6.tar.gz caelestia-shell-cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6.tar.bz2 caelestia-shell-cdc6776eeb4ad014dfa4f1a3a853744d1443a2d6.zip | |
dashboard: animate media visualiser colour
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/dashboard/Media.qml | 13 |
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 { |