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.pixelSize: 72
|
||||||
font.family: M.Theme.fontFamily
|
font.family: M.Theme.fontFamily
|
||||||
font.bold: true
|
font.bold: true
|
||||||
|
opacity: 0.85
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
property int _colorIdx: 0
|
property int _colorIdx: 0
|
||||||
|
|
@ -113,13 +114,13 @@ PanelWindow {
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
enabled: !M.Theme.reducedMotion
|
enabled: !M.Theme.reducedMotion
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
duration: 800
|
duration: 500
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fired once per second in sync with the clock tick
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
loops: Animation.Infinite
|
id: colonAnim
|
||||||
running: !M.Theme.reducedMotion
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: colon
|
target: colon
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
|
|
@ -127,12 +128,6 @@ PanelWindow {
|
||||||
duration: 150
|
duration: 150
|
||||||
easing.type: Easing.InOutSine
|
easing.type: Easing.InOutSine
|
||||||
}
|
}
|
||||||
PauseAnimation {
|
|
||||||
duration: 700
|
|
||||||
}
|
|
||||||
ScriptAction {
|
|
||||||
script: colon._colorIdx++
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: colon
|
target: colon
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
|
|
@ -140,8 +135,15 @@ PanelWindow {
|
||||||
duration: 150
|
duration: 150
|
||||||
easing.type: Easing.InOutSine
|
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