fix: sync colon and seconds bar animations to clock tick; colon no longer self-loops
This commit is contained in:
parent
a7f0fd2785
commit
f5e076c7ac
1 changed files with 13 additions and 11 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue