dedup, monospace font for icons
This commit is contained in:
parent
cd45c2d9cf
commit
00838e1d64
18 changed files with 67 additions and 80 deletions
|
|
@ -11,23 +11,19 @@ Row {
|
|||
readonly property real pct: (dev?.percentage ?? 0) * 100
|
||||
readonly property bool charging: dev?.state === UPowerDeviceState.Charging
|
||||
|
||||
Text {
|
||||
text: {
|
||||
if (root.charging)
|
||||
return "";
|
||||
M.BarIcon {
|
||||
icon: {
|
||||
if (root.charging) return "";
|
||||
const icons = ["", "", "", "", "", "", "", "", "", "", ""];
|
||||
return icons[Math.min(10, Math.floor(root.pct / 10))];
|
||||
}
|
||||
color: root.pct < 15 ? M.Theme.base08 : M.Theme.base05
|
||||
font.pixelSize: M.Theme.fontSize + 2
|
||||
font.family: M.Theme.fontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
Text {
|
||||
text: Math.round(root.pct) + "%"
|
||||
M.BarLabel {
|
||||
label: Math.round(root.pct) + "%"
|
||||
color: root.pct < 15 ? M.Theme.base08 : M.Theme.base05
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.fontFamily
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue