ok
This commit is contained in:
parent
2cf07696f7
commit
356a00429c
1 changed files with 5 additions and 5 deletions
|
@ -126,16 +126,16 @@ function BatteryLabel() {
|
||||||
const icon = battery.bind("percent").as(p =>
|
const icon = battery.bind("percent").as(p =>
|
||||||
`battery-level-${Math.floor(p / 10) * 10}-symbolic`)
|
`battery-level-${Math.floor(p / 10) * 10}-symbolic`)
|
||||||
|
|
||||||
|
const percent = battery.bind("percent").as(x = x.toString) + "%"
|
||||||
|
|
||||||
return Widget.Box({
|
return Widget.Box({
|
||||||
class_name: "battery",
|
class_name: "battery",
|
||||||
visible: battery.bind("available"),
|
visible: battery.bind("available"),
|
||||||
children: [
|
children: [
|
||||||
Widget.Icon({ icon }),
|
Widget.Icon({ icon }),
|
||||||
Widget.LevelBar({
|
Widget.Label({
|
||||||
widthRequest: 140,
|
label: percent,
|
||||||
vpack: "center",
|
})
|
||||||
value,
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue