Skip to content

Commit

Permalink
chore: disable timezone clock animation
Browse files Browse the repository at this point in the history
Temporarily disable animations
TODO: only enable animation on add timezone
  • Loading branch information
kegechen committed Dec 18, 2024
1 parent af2e8de commit 1676565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/plugin-datetime/qml/TimezoneClock.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Item {

property int hours
property int minutes
property int seconds
property real shift: 8 // (UTC+08)
property bool internationalTime: true
property bool animationEnabled: false

width: 80
height: 80
Expand All @@ -23,7 +23,6 @@ Item {
const date = new Date
clock.hours = internationalTime ? date.getUTCHours() + Math.floor(clock.shift) : date.getHours()
clock.minutes = internationalTime ? date.getUTCMinutes() + ((clock.shift % 1) * 60) : date.getMinutes()
clock.seconds = date.getUTCSeconds()
if (clock.hours < 0)
clock.hours += 12
}
Expand Down Expand Up @@ -64,6 +63,7 @@ Item {
origin.y: 2
angle: (clock.hours * 30) + (clock.minutes * 0.5) - 90
Behavior on angle {
enabled: clock.animationEnabled
SpringAnimation {
spring: 2
damping: 0.2
Expand All @@ -88,6 +88,7 @@ Item {
origin.y: 2
angle: clock.minutes * 6 - 90
Behavior on angle {
enabled: clock.animationEnabled
SpringAnimation {
spring: 2
damping: 0.2
Expand Down

0 comments on commit 1676565

Please sign in to comment.