From 1f700f33b2c6ff52f22e76d0758fc33c933ebf12 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 23 Sep 2025 11:13:18 +0200 Subject: [PATCH] cookie clock: put color props to root --- .../ii/modules/background/Background.qml | 3 ++- .../ii/modules/background/CookieClock.qml | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.config/quickshell/ii/modules/background/Background.qml b/.config/quickshell/ii/modules/background/Background.qml index 0f9900c2a..46fc3c62d 100644 --- a/.config/quickshell/ii/modules/background/Background.qml +++ b/.config/quickshell/ii/modules/background/Background.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import qs import qs.services import qs.modules.common +import qs.modules.common.models import qs.modules.common.widgets import qs.modules.common.functions as CF import QtQuick @@ -64,7 +65,7 @@ Variants { } // Colors property bool shouldBlur: (GlobalStates.screenLocked && Config.options.lock.blur.enable) - property color dominantColor: Appearance.colors.colPrimary + property color dominantColor: Appearance.colors.colPrimary // Default, to be changed property bool dominantColorIsDark: dominantColor.hslLightness < 0.5 property color colText: { if (wallpaperSafetyTriggered) diff --git a/.config/quickshell/ii/modules/background/CookieClock.qml b/.config/quickshell/ii/modules/background/CookieClock.qml index b6c2f9655..88ad5a90f 100644 --- a/.config/quickshell/ii/modules/background/CookieClock.qml +++ b/.config/quickshell/ii/modules/background/CookieClock.qml @@ -20,11 +20,17 @@ Item { property real minuteHandWidth: 8 property real centerDotSize: 10 property real hourDotSize: minuteHandWidth - property color colOnBackground: ColorUtils.mix(Appearance.colors.colPrimary, Appearance.colors.colSecondaryContainer, 0.5) - property list clockNumbers: DateTime.time.split(/[: ]/) - property int clockHour: parseInt(clockNumbers[0]) % 12 - property int clockMinute: parseInt(clockNumbers[1]) + property color colShadow: Appearance.colors.colShadow + property color colBackground: Appearance.colors.colSecondaryContainer + property color colOnBackground: ColorUtils.mix(Appearance.colors.colPrimary, Appearance.colors.colSecondaryContainer, 0.5) + property color colHourHand: Appearance.colors.colPrimary + property color colMinuteHand: Appearance.colors.colSecondary + property color colOnHourHand: Appearance.colors.colOnPrimary + + readonly property list clockNumbers: DateTime.time.split(/[: ]/) + readonly property int clockHour: parseInt(clockNumbers[0]) % 12 + readonly property int clockMinute: parseInt(clockNumbers[1]) implicitWidth: implicitSize implicitHeight: implicitSize @@ -35,7 +41,7 @@ Item { verticalOffset: 2 radius: 12 samples: radius * 2 + 1 - color: Appearance.colors.colShadow + color: root.colShadow transparentBorder: true } @@ -45,7 +51,7 @@ Item { implicitSize: root.implicitSize amplitude: implicitSize / 70 sides: 12 - color: Appearance.colors.colSecondaryContainer + color: root.colBackground // 12 dots around the cookie Repeater { @@ -105,7 +111,7 @@ Item { width: hourHandLength height: hourHandWidth radius: hourHandWidth / 2 - color: Appearance.colors.colPrimary + color: root.colHourHand } } @@ -120,14 +126,14 @@ Item { width: minuteHandLength height: minuteHandWidth radius: minuteHandWidth / 2 - color: Appearance.colors.colSecondary + color: root.colMinuteHand } } // Center dot Rectangle { z: 4 - color: Appearance.colors.colOnPrimary + color: root.colOnHourHand anchors.centerIn: parent implicitWidth: centerDotSize implicitHeight: implicitWidth