disk module: warn color when any mount exceeds threshold (default 85%)

This commit is contained in:
Damocles 2026-04-22 20:06:08 +02:00
parent ad24015487
commit 621ec3bfc5
2 changed files with 11 additions and 1 deletions

View file

@ -11,6 +11,13 @@ M.BarSection {
property var _mounts: S.SystemStats.diskMounts
property int _rootPct: S.SystemStats.diskRootPct
readonly property int _warnThreshold: S.Modules.disk.warnThreshold ?? 85
readonly property bool _anyWarn: {
for (const m of _mounts)
if (m.pct >= _warnThreshold)
return true;
return false;
}
property bool _pinned: false
readonly property bool _anyHover: root._hovered || hoverPanel.panelHovered
@ -31,6 +38,7 @@ M.BarSection {
M.BarIcon {
icon: "\uF0C9"
color: root._anyWarn ? S.Theme.base09 : root.accentColor
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned
@ -39,6 +47,7 @@ M.BarSection {
M.BarLabel {
label: root._rootPct + "%"
minText: "100%"
color: root._anyWarn ? S.Theme.base09 : root.accentColor
anchors.verticalCenter: parent.verticalCenter
TapHandler {
onTapped: root._pinned = !root._pinned

View file

@ -70,7 +70,8 @@ QtObject {
})
property var disk: ({
enable: true,
interval: 30000
interval: 30000,
warnThreshold: 85
})
property var battery: ({
enable: true,