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 // Second hand
Loader { Loader {
id: secondHandLoader
active: Config.options.time.secondPrecision && Config.options.background.clock.cookie.secondHandStyle !== "none" active: Config.options.time.secondPrecision && Config.options.background.clock.cookie.secondHandStyle !== "none"
anchors.fill: parent anchors.fill: parent
sourceComponent: SecondHand { sourceComponent: SecondHand {
@@ -13,13 +13,14 @@ Item {
property color colOnBackground: Appearance.colors.colOnSecondaryContainer property color colOnBackground: Appearance.colors.colOnSecondaryContainer
property color colOnSecondary: Appearance.colors.colOnSecondaryContainer property color colOnSecondary: Appearance.colors.colOnSecondaryContainer
Canvas { Canvas {
z: 0 z: 0
width: parent.width width: parent.width
height: parent.height height: parent.height
rotation: { rotation: {
if (!Config.options.time.secondPrecision) return 0; 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 opacity: root.style === "rotating" ? 1.0 : 0