clock: code cleanups + cookie by default

This commit is contained in:
nrand
2025-11-14 17:49:02 +02:00
parent a065829eee
commit bd284a5ef4
2 changed files with 13 additions and 3 deletions
@@ -158,7 +158,7 @@ Singleton {
property real x: 100 property real x: 100
property real y: 100 property real y: 100
property string style: "cookie" // Options: "cookie", "digital" 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 JsonObject cookie: JsonObject {
property bool aiStyling: false property bool aiStyling: false
property int sides: 14 property int sides: 14
@@ -57,8 +57,18 @@ ContentPage {
title: Translation.tr("Widget: Clock") title: Translation.tr("Widget: Clock")
id: settingsClock 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" function stylePresent(styleName) {
readonly property bool cookiePresent: (!Config.options.background.widgets.clock.showOnlyWhenLocked && Config.options.background.widgets.clock.style === "cookie") || Config.options.background.widgets.clock.styleLocked === "cookie" 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 { ConfigRow {
Layout.fillWidth: true Layout.fillWidth: true