make 'numbers' dial and 'rotating' date respect each other on position

This commit is contained in:
darksignal7
2025-10-08 19:00:21 +03:00
parent 6c23d482dd
commit eeed075be2
2 changed files with 15 additions and 2 deletions
@@ -18,7 +18,9 @@ Item {
Loader {
anchors.fill: parent
active: opacity > 0
sourceComponent: RotatingDate {}
sourceComponent: RotatingDate {
style: root.style
}
}
// Square date (only today's number) in right side of the clock
@@ -9,7 +9,13 @@ import QtQuick
Item {
id: root
property real radius: 65
property string style: Config.options.background.clock.cookie.dateStyle
readonly property string dialStyle: Config.options.background.clock.cookie.dialNumberStyle
property real radius: style === "rotating" ? dialStyle === "numbers" ? 90 : 65 : 0
Behavior on radius {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
property string dateText: Qt.locale().toString(DateTime.clock.date, "ddd dd")
property real angleStep: Math.PI / 2.35 / dateText.length
@@ -17,6 +23,11 @@ Item {
property color dayColor: Appearance.colors.colSecondary
property color monthColor: Appearance.colors.colSecondaryHover
opacity: style === "rotating" ? 1.0 : 0.0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
rotation: {
if (!Config.options.time.secondPrecision) return 0
else return secondHandLoader.item.rotation + 45 // +45 to center the text