From 7eb5fa8d8ee60b5327255018bf7efcea06072470 Mon Sep 17 00:00:00 2001 From: darksignal7 Date: Sun, 5 Oct 2025 16:17:37 +0300 Subject: [PATCH] add hour hand style --- .../ii/modules/background/CookieClock.qml | 12 ++++++---- .../quickshell/ii/modules/common/Config.qml | 1 + .../ii/modules/settings/InterfaceConfig.qml | 24 +++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.config/quickshell/ii/modules/background/CookieClock.qml b/.config/quickshell/ii/modules/background/CookieClock.qml index e11c32d85..d87623692 100644 --- a/.config/quickshell/ii/modules/background/CookieClock.qml +++ b/.config/quickshell/ii/modules/background/CookieClock.qml @@ -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 diff --git a/.config/quickshell/ii/modules/common/Config.qml b/.config/quickshell/ii/modules/common/Config.qml index 19664751d..cfd38cc50 100644 --- a/.config/quickshell/ii/modules/common/Config.qml +++ b/.config/quickshell/ii/modules/common/Config.qml @@ -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" diff --git a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml index 3d2603283..ad31329b3 100644 --- a/.config/quickshell/ii/modules/settings/InterfaceConfig.qml +++ b/.config/quickshell/ii/modules/settings/InterfaceConfig.qml @@ -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"