From 834bf808d0cb5bf206900d05169e00de0e1c8f54 Mon Sep 17 00:00:00 2001 From: Damocles Date: Sun, 12 Apr 2026 22:14:45 +0200 Subject: [PATCH] propagate group accent color to modules via accentColor chain --- modules/Backlight.qml | 2 -- modules/BarGroup.qml | 1 + modules/BarIcon.qml | 2 +- modules/BarLabel.qml | 2 +- modules/BarSection.qml | 1 + modules/Battery.qml | 2 +- modules/Bluetooth.qml | 2 +- modules/Clock.qml | 1 - modules/Cpu.qml | 2 -- modules/Disk.qml | 4 ++-- modules/IdleInhibitor.qml | 2 +- modules/Memory.qml | 4 ++-- modules/Mpris.qml | 2 -- modules/Network.qml | 4 ++-- modules/Notifications.qml | 3 +-- modules/Power.qml | 1 - modules/PowerProfile.qml | 2 +- modules/Temperature.qml | 2 +- modules/Volume.qml | 2 +- modules/Weather.qml | 1 - 20 files changed, 17 insertions(+), 25 deletions(-) diff --git a/modules/Backlight.qml b/modules/Backlight.qml index 7ac38a1..525cdab 100644 --- a/modules/Backlight.qml +++ b/modules/Backlight.qml @@ -85,13 +85,11 @@ M.BarSection { M.BarIcon { icon: "\uF185" - color: M.Theme.base0A anchors.verticalCenter: parent.verticalCenter } M.BarLabel { label: root.percent + "%" minText: "100%" - color: M.Theme.base0A anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/BarGroup.qml b/modules/BarGroup.qml index 05f50bd..13a6251 100644 --- a/modules/BarGroup.qml +++ b/modules/BarGroup.qml @@ -84,6 +84,7 @@ Item { Row { id: row + property color accentColor: root.borderColor anchors.centerIn: parent spacing: M.Theme.moduleSpacing + 2 } diff --git a/modules/BarIcon.qml b/modules/BarIcon.qml index 4797021..43b624b 100644 --- a/modules/BarIcon.qml +++ b/modules/BarIcon.qml @@ -42,7 +42,7 @@ Text { } width: minIcon ? Math.max(implicitWidth, _minIconMetrics.width) : implicitWidth horizontalAlignment: minIcon ? Text.AlignHCenter : Text.AlignLeft - color: M.Theme.base05 + color: parent?.accentColor ?? M.Theme.base05 font.pixelSize: M.Theme.fontSize + 1 font.family: M.Theme.iconFontFamily verticalAlignment: Text.AlignVCenter diff --git a/modules/BarLabel.qml b/modules/BarLabel.qml index 3f1ce9d..f5f2cc3 100644 --- a/modules/BarLabel.qml +++ b/modules/BarLabel.qml @@ -13,7 +13,7 @@ Text { text: label width: minText ? Math.max(implicitWidth, _minMetrics.width) : implicitWidth horizontalAlignment: minText ? Text.AlignHCenter : Text.AlignLeft - color: M.Theme.base05 + color: parent?.accentColor ?? M.Theme.base05 font.pixelSize: M.Theme.fontSize font.family: M.Theme.fontFamily verticalAlignment: Text.AlignVCenter diff --git a/modules/BarSection.qml b/modules/BarSection.qml index 59c118e..3384bb6 100644 --- a/modules/BarSection.qml +++ b/modules/BarSection.qml @@ -7,6 +7,7 @@ Row { id: root property string tooltip: "" property bool _hovered: false + property color accentColor: parent?.accentColor ?? M.Theme.base05 Behavior on opacity { NumberAnimation { diff --git a/modules/Battery.qml b/modules/Battery.qml index 2f8884a..df60c3e 100644 --- a/modules/Battery.qml +++ b/modules/Battery.qml @@ -22,7 +22,7 @@ M.BarSection { readonly property int _critThresh: M.Modules.battery.critical || 15 readonly property int _warnThresh: M.Modules.battery.warning || 25 readonly property bool _critical: pct < _critThresh && !charging - property color _stateColor: charging ? M.Theme.base0B : _critical ? M.Theme.base09 : pct < _warnThresh ? M.Theme.base0A : M.Theme.base08 + property color _stateColor: charging ? M.Theme.base0B : _critical ? M.Theme.base09 : pct < _warnThresh ? M.Theme.base0A : root.accentColor property real _blinkOpacity: 1 SequentialAnimation { diff --git a/modules/Bluetooth.qml b/modules/Bluetooth.qml index 9b7a888..987e938 100644 --- a/modules/Bluetooth.qml +++ b/modules/Bluetooth.qml @@ -73,7 +73,7 @@ M.BarSection { M.BarIcon { icon: "\uF294" - color: root.state === "connected" ? M.Theme.base0D : root.state === "off" ? M.Theme.base04 : M.Theme.base0D + color: root.state === "off" ? M.Theme.base04 : root.accentColor anchors.verticalCenter: parent.verticalCenter } M.BarLabel { diff --git a/modules/Clock.qml b/modules/Clock.qml index 58c4d54..6506124 100644 --- a/modules/Clock.qml +++ b/modules/Clock.qml @@ -8,7 +8,6 @@ M.BarLabel { precision: SystemClock.Seconds } - color: M.Theme.base0D font.pixelSize: M.Theme.fontSize + 1 label: Qt.formatDateTime(clock.date, "ddd, dd. MMM HH:mm") tooltip: Qt.formatDateTime(clock.date, "dddd, dd. MMMM yyyy\nHH:mm:ss") diff --git a/modules/Cpu.qml b/modules/Cpu.qml index e2422f0..fdb4c88 100644 --- a/modules/Cpu.qml +++ b/modules/Cpu.qml @@ -54,13 +54,11 @@ M.BarSection { M.BarIcon { icon: "\uF2DB" - color: M.Theme.base08 anchors.verticalCenter: parent.verticalCenter } M.BarLabel { label: root.usage.toString().padStart(2) + "%@" + root.freqGhz.toFixed(2) minText: "99%@9.99" - color: M.Theme.base08 anchors.verticalCenter: parent.verticalCenter } } diff --git a/modules/Disk.qml b/modules/Disk.qml index 0b6180e..065f507 100644 --- a/modules/Disk.qml +++ b/modules/Disk.qml @@ -34,13 +34,13 @@ M.BarSection { M.BarIcon { icon: "\uF0C9" - color: M.Theme.base08 + anchors.verticalCenter: parent.verticalCenter } M.BarLabel { label: root.freePct + "% " + root.totalTb.toFixed(1) minText: "100% 9.9" - color: M.Theme.base08 + anchors.verticalCenter: parent.verticalCenter } } diff --git a/modules/IdleInhibitor.qml b/modules/IdleInhibitor.qml index e24543c..d11f56e 100644 --- a/modules/IdleInhibitor.qml +++ b/modules/IdleInhibitor.qml @@ -4,7 +4,7 @@ import "." as M M.BarIcon { id: root - color: root.active ? M.Theme.base0A : M.Theme.base04 + color: root.active ? (parent?.accentColor ?? M.Theme.base05) : M.Theme.base04 tooltip: "Idle inhibition: " + (root.active ? "active" : "inactive") property bool active: false diff --git a/modules/Memory.qml b/modules/Memory.qml index 21395cb..d86c0ce 100644 --- a/modules/Memory.qml +++ b/modules/Memory.qml @@ -34,13 +34,13 @@ M.BarSection { M.BarIcon { icon: "\uEFC5" - color: M.Theme.base08 + anchors.verticalCenter: parent.verticalCenter } M.BarLabel { label: root.percent + "%" minText: "100%" - color: M.Theme.base08 + anchors.verticalCenter: parent.verticalCenter } } diff --git a/modules/Mpris.qml b/modules/Mpris.qml index 452f07b..4754ac5 100644 --- a/modules/Mpris.qml +++ b/modules/Mpris.qml @@ -79,7 +79,6 @@ M.BarSection { M.BarIcon { icon: root.playing ? "\uF04B" : (root.player?.playbackState === MprisPlaybackState.Paused ? "\uDB80\uDFE4" : "\uDB81\uDCDB") - color: M.Theme.base0E anchors.verticalCenter: parent.verticalCenter MouseArea { anchors.fill: parent @@ -89,7 +88,6 @@ M.BarSection { } M.BarLabel { label: root.player?.trackTitle || root.player?.identity || "" - color: M.Theme.base0E elide: Text.ElideRight width: Math.min(implicitWidth, 200) anchors.verticalCenter: parent.verticalCenter diff --git a/modules/Network.qml b/modules/Network.qml index 71b4b69..29dcc3f 100644 --- a/modules/Network.qml +++ b/modules/Network.qml @@ -101,13 +101,13 @@ M.BarSection { return "\uDB85\uDE16"; return "\uDB82\uDCFD"; } - color: root.state === "disconnected" ? M.Theme.base08 : M.Theme.base0D + color: root.state === "disconnected" ? M.Theme.base08 : root.accentColor anchors.verticalCenter: parent.verticalCenter } M.BarLabel { visible: root.state === "wifi" label: root.essid - color: root.state === "disconnected" ? M.Theme.base08 : M.Theme.base0D + color: root.state === "disconnected" ? M.Theme.base08 : root.accentColor anchors.verticalCenter: parent.verticalCenter } diff --git a/modules/Notifications.qml b/modules/Notifications.qml index 81919ed..45fa9c7 100644 --- a/modules/Notifications.qml +++ b/modules/Notifications.qml @@ -44,13 +44,12 @@ M.BarSection { return root.count > 0 ? "\uDB80\uDCA0" : "\uDB82\uDE93"; return root.count > 0 ? "\uDB84\uDD6B" : "\uDB80\uDC9C"; } - color: root.count > 0 ? M.Theme.base0D : (root.dnd ? M.Theme.base04 : M.Theme.base0D) + color: root.dnd ? M.Theme.base04 : root.accentColor anchors.verticalCenter: parent.verticalCenter } M.BarLabel { id: countLabel label: root.count > 0 ? String(root.count) : "" - color: M.Theme.base0D anchors.verticalCenter: parent.verticalCenter transform: Scale { diff --git a/modules/Power.qml b/modules/Power.qml index f50597d..bb90659 100644 --- a/modules/Power.qml +++ b/modules/Power.qml @@ -6,7 +6,6 @@ import "." as M M.BarIcon { id: root icon: "\uF011" - color: M.Theme.base08 tooltip: "Power menu" required property var bar diff --git a/modules/PowerProfile.qml b/modules/PowerProfile.qml index 483ca0e..41977a9 100644 --- a/modules/PowerProfile.qml +++ b/modules/PowerProfile.qml @@ -8,7 +8,7 @@ M.BarIcon { property string profile: "" - color: root.profile === "performance" ? M.Theme.base09 : root.profile === "power-saver" ? M.Theme.base0B : M.Theme.base0A + color: root.profile === "performance" ? M.Theme.base09 : root.profile === "power-saver" ? M.Theme.base0B : parent?.accentColor ?? M.Theme.base05 icon: { if (root.profile === "performance") diff --git a/modules/Temperature.qml b/modules/Temperature.qml index 64ec432..ec2983c 100644 --- a/modules/Temperature.qml +++ b/modules/Temperature.qml @@ -8,7 +8,7 @@ M.BarSection { tooltip: "Temperature: " + root.celsius + "\u00B0C" property int celsius: 0 - property color _stateColor: celsius > (M.Modules.temperature.hot || 80) ? M.Theme.base09 : celsius > (M.Modules.temperature.warm || 60) ? M.Theme.base0A : M.Theme.base08 + property color _stateColor: celsius > (M.Modules.temperature.hot || 80) ? M.Theme.base09 : celsius > (M.Modules.temperature.warm || 60) ? M.Theme.base0A : root.accentColor Behavior on _stateColor { ColorAnimation { duration: 300 diff --git a/modules/Volume.qml b/modules/Volume.qml index 428741d..ea31282 100644 --- a/modules/Volume.qml +++ b/modules/Volume.qml @@ -17,7 +17,7 @@ M.BarSection { readonly property real volume: sink?.audio?.volume ?? 0 readonly property bool muted: sink?.audio?.muted ?? false readonly property string _volumeIcon: muted ? "\uF026" : (volume > 0.5 ? "\uF028" : (volume > 0 ? "\uF027" : "\uF026")) - readonly property color _volumeColor: muted ? M.Theme.base04 : M.Theme.base0E + readonly property color _volumeColor: muted ? M.Theme.base04 : root.accentColor readonly property var _sinkList: { const sinks = []; diff --git a/modules/Weather.qml b/modules/Weather.qml index 3910c6d..4cdec41 100644 --- a/modules/Weather.qml +++ b/modules/Weather.qml @@ -35,7 +35,6 @@ M.BarSection { M.BarIcon { id: label - color: M.Theme.base08 anchors.verticalCenter: parent.verticalCenter } }