propagate group accent color to modules via accentColor chain

This commit is contained in:
Damocles 2026-04-12 22:14:45 +02:00
parent ec8672e837
commit 834bf808d0
20 changed files with 17 additions and 25 deletions

View file

@ -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
}

View file

@ -84,6 +84,7 @@ Item {
Row {
id: row
property color accentColor: root.borderColor
anchors.centerIn: parent
spacing: M.Theme.moduleSpacing + 2
}

View file

@ -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

View file

@ -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

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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")

View file

@ -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
}
}

View file

@ -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
}
}

View file

@ -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

View file

@ -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
}
}

View file

@ -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

View file

@ -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
}

View file

@ -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 {

View file

@ -6,7 +6,6 @@ import "." as M
M.BarIcon {
id: root
icon: "\uF011"
color: M.Theme.base08
tooltip: "Power menu"
required property var bar

View file

@ -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")

View file

@ -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

View file

@ -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 = [];

View file

@ -35,7 +35,6 @@ M.BarSection {
M.BarIcon {
id: label
color: M.Theme.base08
anchors.verticalCenter: parent.verticalCenter
}
}