Highligt low supplies

This commit is contained in:
Anton Thomasson 2022-01-13 21:09:25 +01:00
parent 9da439e463
commit cd90064f9a

View file

@ -8,7 +8,7 @@ import "../components"
property var color: "white" property var color: "white"
property int level: 100 property int level: 100
property int high_level: 100 property int high_level: 100
property int low_level: 0 property int low_level: 10
property string name: "" property string name: ""
property string type: "" property string type: ""
@ -26,7 +26,7 @@ import "../components"
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: Theme.itemSizeExtraSmall width: Theme.itemSizeExtraSmall
text: ""+(100*level/high_level)+"%" text: ""+(100*level/high_level)+"%"
color: Theme.highlightColor color: level <= low_level ? "red" : Theme.highlightColor
font.pixelSize: Theme.fontSizeExtraSmall font.pixelSize: Theme.fontSizeExtraSmall
} }
Column Column