From f5e076c7ac4fdff39f2c0e291882467974e4edc6 Mon Sep 17 00:00:00 2001 From: Damocles Date: Wed, 15 Apr 2026 19:51:37 +0200 Subject: [PATCH] fix: sync colon and seconds bar animations to clock tick; colon no longer self-loops --- modules/BackgroundOverlay.qml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/BackgroundOverlay.qml b/modules/BackgroundOverlay.qml index 12c27b9..70a98fc 100644 --- a/modules/BackgroundOverlay.qml +++ b/modules/BackgroundOverlay.qml @@ -105,6 +105,7 @@ PanelWindow { font.pixelSize: 72 font.family: M.Theme.fontFamily font.bold: true + opacity: 0.85 anchors.verticalCenter: parent.verticalCenter property int _colorIdx: 0 @@ -113,13 +114,13 @@ PanelWindow { Behavior on color { enabled: !M.Theme.reducedMotion ColorAnimation { - duration: 800 + duration: 500 } } + // Fired once per second in sync with the clock tick SequentialAnimation { - loops: Animation.Infinite - running: !M.Theme.reducedMotion + id: colonAnim NumberAnimation { target: colon property: "opacity" @@ -127,12 +128,6 @@ PanelWindow { duration: 150 easing.type: Easing.InOutSine } - PauseAnimation { - duration: 700 - } - ScriptAction { - script: colon._colorIdx++ - } NumberAnimation { target: colon property: "opacity" @@ -140,8 +135,15 @@ PanelWindow { duration: 150 easing.type: Easing.InOutSine } - PauseAnimation { - duration: 700 + } + + Connections { + target: clock + function onDateChanged() { + if (M.Theme.reducedMotion) + return; + colon._colorIdx++; + colonAnim.restart(); } } }