From bd284a5ef457dc31b55789dc653ac00482c3144e Mon Sep 17 00:00:00 2001 From: nrand Date: Fri, 14 Nov 2025 17:49:02 +0200 Subject: [PATCH] clock: code cleanups + cookie by default --- .../quickshell/ii/modules/common/Config.qml | 2 +- .../ii/modules/settings/BackgroundConfig.qml | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/common/Config.qml b/dots/.config/quickshell/ii/modules/common/Config.qml index 2987faed2..a71f6e9e7 100644 --- a/dots/.config/quickshell/ii/modules/common/Config.qml +++ b/dots/.config/quickshell/ii/modules/common/Config.qml @@ -158,7 +158,7 @@ Singleton { property real x: 100 property real y: 100 property string style: "cookie" // Options: "cookie", "digital" - property string styleLocked: "digital" // Options: "cookie", "digital" + property string styleLocked: "cookie" // Options: "cookie", "digital" property JsonObject cookie: JsonObject { property bool aiStyling: false property int sides: 14 diff --git a/dots/.config/quickshell/ii/modules/settings/BackgroundConfig.qml b/dots/.config/quickshell/ii/modules/settings/BackgroundConfig.qml index c12a04c54..66630cc24 100644 --- a/dots/.config/quickshell/ii/modules/settings/BackgroundConfig.qml +++ b/dots/.config/quickshell/ii/modules/settings/BackgroundConfig.qml @@ -57,8 +57,18 @@ ContentPage { title: Translation.tr("Widget: Clock") id: settingsClock - readonly property bool digitalPresent: (!Config.options.background.widgets.clock.showOnlyWhenLocked && Config.options.background.widgets.clock.style === "digital") || Config.options.background.widgets.clock.styleLocked === "digital" - readonly property bool cookiePresent: (!Config.options.background.widgets.clock.showOnlyWhenLocked && Config.options.background.widgets.clock.style === "cookie") || Config.options.background.widgets.clock.styleLocked === "cookie" + function stylePresent(styleName) { + if (!Config.options.background.widgets.clock.showOnlyWhenLocked && Config.options.background.widgets.clock.style === styleName) { + return true; + } + if (Config.options.background.widgets.clock.styleLocked === styleName) { + return true; + } + return false; + } + + readonly property bool digitalPresent: stylePresent("digital") + readonly property bool cookiePresent: stylePresent("cookie") ConfigRow { Layout.fillWidth: true