forked from Shinonome/dots-hyprland
make 'numbers' dial and 'rotating' date respect each other on position
This commit is contained in:
+3
-1
@@ -18,7 +18,9 @@ Item {
|
|||||||
Loader {
|
Loader {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
active: opacity > 0
|
active: opacity > 0
|
||||||
sourceComponent: RotatingDate {}
|
sourceComponent: RotatingDate {
|
||||||
|
style: root.style
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Square date (only today's number) in right side of the clock
|
// Square date (only today's number) in right side of the clock
|
||||||
|
|||||||
+12
-1
@@ -9,7 +9,13 @@ import QtQuick
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
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 string dateText: Qt.locale().toString(DateTime.clock.date, "ddd dd")
|
||||||
property real angleStep: Math.PI / 2.35 / dateText.length
|
property real angleStep: Math.PI / 2.35 / dateText.length
|
||||||
@@ -17,6 +23,11 @@ Item {
|
|||||||
property color dayColor: Appearance.colors.colSecondary
|
property color dayColor: Appearance.colors.colSecondary
|
||||||
property color monthColor: Appearance.colors.colSecondaryHover
|
property color monthColor: Appearance.colors.colSecondaryHover
|
||||||
|
|
||||||
|
opacity: style === "rotating" ? 1.0 : 0.0
|
||||||
|
Behavior on opacity {
|
||||||
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
|
}
|
||||||
|
|
||||||
rotation: {
|
rotation: {
|
||||||
if (!Config.options.time.secondPrecision) return 0
|
if (!Config.options.time.secondPrecision) return 0
|
||||||
else return secondHandLoader.item.rotation + 45 // +45 to center the text
|
else return secondHandLoader.item.rotation + 45 // +45 to center the text
|
||||||
|
|||||||
Reference in New Issue
Block a user