5import QGroundControl.Controls
7/// Bar of the emergency, critical and low battery levels, each a fraction of full charge
9 property real emergency: 0
10 property real critical: 0
13 spacing: ScreenTools.defaultFontPixelHeight * 0.25
20 Layout.preferredWidth: ScreenTools.defaultFontPixelWidth * 28
21 Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 0.75
25 { "from": 0, "to": emergency, "color": barPal.colorRed },
26 { "from": emergency, "to": critical, "color": barPal.colorOrange },
27 { "from": critical, "to": low, "color": barPal.colorYellow },
28 { "from": low, "to": 1, "color": barPal.colorGreen }
32 width: Math.max(0, (modelData.to - modelData.from)) * parent.width
34 color: modelData.color
36 required property var modelData
42 font.pointSize: ScreenTools.smallFontPointSize
43 color: barPal.textSecondary
44 text: qsTr("Emergency %1%, critical %2%, low %3%")
45 .arg(Math.round(emergency * 100))
46 .arg(Math.round(critical * 100))
47 .arg(Math.round(low * 100))