add hour hand style

This commit is contained in:
darksignal7
2025-10-05 16:17:37 +03:00
parent a90e2132e3
commit 7eb5fa8d8e
3 changed files with 32 additions and 5 deletions
@@ -22,7 +22,7 @@ Item {
property real hourHandWidth: 20
property real minuteHandLength: 95
property real minuteHandWidth: Config.options.background.clock.cookie.minuteHandStyle === "bold" ? hourHandWidth :
Config.options.background.clock.cookie.minuteHandStyle === "medium" ? 12 : 6
Config.options.background.clock.cookie.minuteHandStyle === "medium" ? 12 : 5
property real centerDotSize: 10
property real hourDotSize: 12
property real centerGlowSize: 135
@@ -204,7 +204,7 @@ Item {
// Hour hand
Item {
anchors.fill: parent
z: 3
z: Config.options.background.clock.cookie.hourHandStyle === "fill" ? 3 : 1
rotation: -90 + (360 / 12) * (root.clockHour + root.clockMinute / 60)
Rectangle {
anchors.verticalCenter: parent.verticalCenter
@@ -212,7 +212,9 @@ Item {
width: hourHandLength
height: hourHandWidth
radius: hourHandWidth / 2
color: root.colHourHand
color: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? "transparent" : root.colHourHand
border.color: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? root.colHourHand : "transparent"
border.width: Config.options.background.clock.cookie.hourHandStyle === "stroke" ? 4 : 0
}
}
@@ -239,12 +241,12 @@ Item {
// Center dot
Rectangle {
opacity: Config.options.background.clock.cookie.minuteHandStyle === "medium" ? 1.0 : 0 // Not using visible to allow smooth transition
opacity: Config.options.background.clock.cookie.minuteHandStyle !== "bold" ? 1.0 : 0 // Not using visible to allow smooth transition
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
z: 4
color: root.colOnHourHand
color: Config.options.background.clock.cookie.minuteHandStyle === "medium" ? root.colBackground : root.colMinuteHand
anchors.centerIn: parent
implicitWidth: centerDotSize
implicitHeight: implicitWidth
@@ -132,6 +132,7 @@ Singleton {
property int clockSides: 12
property JsonObject cookie: JsonObject {
property string dialNumberStyle: "dots" // Options: "dots" , "numbers", "full" , "none"
property string hourHandStyle: "fill" // Options: "fill", "stroke"
property string minuteHandStyle: "medium" // Options: "medium", "bold"
property string secondHandStyle: "dot" // Options: "dot", "line" , "none"
property string dateStyle: "rotating" // Options: "rotating", "square", "none"
@@ -204,6 +204,30 @@ ContentPage {
}
}
ContentSubsection {
enabled: Config.options.background.clock.style === "cookie"
visible: Config.options.background.clock.style === "cookie"
title: Translation.tr("Hour hand style")
ConfigSelectionArray {
currentValue: Config.options.background.clock.cookie.hourHandStyle
onSelected: newValue => {
Config.options.background.clock.cookie.hourHandStyle = newValue;
}
options: [
{
displayName: Translation.tr("Fill"),
icon: "stroke_full",
value: "fill"
},
{
displayName: Translation.tr("Stroke"),
icon: "stroke_partial",
value: "stroke"
}
]
}
}
ConfigSpinBox {
enabled: Config.options.background.clock.style === "cookie"
visible: Config.options.background.clock.style === "cookie"