disk module: warn color when any mount exceeds threshold (default 85%)
This commit is contained in:
parent
ad24015487
commit
621ec3bfc5
2 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue