make rotating date indicator rotate with secondHand

This commit is contained in:
darksignal7
2025-10-06 18:41:45 +03:00
parent 594dc64824
commit 0e89e8dcc2
2 changed files with 4 additions and 2 deletions
@@ -109,6 +109,7 @@ Item {
// Second hand
Loader {
id: secondHandLoader
active: Config.options.time.secondPrecision && Config.options.background.clock.cookie.secondHandStyle !== "none"
anchors.fill: parent
sourceComponent: SecondHand {
@@ -12,6 +12,7 @@ Item {
property string style: "rotating"
property color colOnBackground: Appearance.colors.colOnSecondaryContainer
property color colOnSecondary: Appearance.colors.colOnSecondaryContainer
Canvas {
z: 0
@@ -19,14 +20,14 @@ Item {
height: parent.height
rotation: {
if (!Config.options.time.secondPrecision) return 0;
return secondHand.rotation + 45 // +45 degrees to align with minute hand
return secondHandLoader.item.rotation + 45 // +45 degrees to align with minute hand
}
opacity: root.style === "rotating" ? 1.0 : 0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
onPaint: {
var ctx = getContext("2d");
ctx.clearRect(0, 0, width, height);