bar: warning for high resource usage

This commit is contained in:
end-4
2025-08-26 09:15:59 +07:00
parent 376f2bfeb1
commit 63b7a3a36c
6 changed files with 22 additions and 13 deletions
@@ -10,11 +10,13 @@ Item {
id: root
required property string iconName
required property double percentage
property int warningThreshold: 100
property bool shown: true
clip: true
visible: width > 0 && height > 0
implicitWidth: resourceRowLayout.x < 0 ? 0 : resourceRowLayout.implicitWidth
implicitHeight: Appearance.sizes.barHeight
property bool warning: percentage * 100 >= warningThreshold
RowLayout {
id: resourceRowLayout
@@ -30,7 +32,8 @@ Item {
lineWidth: Appearance.rounding.unsharpen
value: percentage
implicitSize: 20
colPrimary: Appearance.colors.colOnSecondaryContainer
colPrimary: root.warning ? Appearance.colors.colError : Appearance.colors.colOnSecondaryContainer
accountForLightBleeding: !root.warning
enableAnimation: false
Item {