This commit is contained in:
Sakooooo 2024-08-08 13:45:59 +04:00
parent 2cf07696f7
commit 356a00429c
Signed by: sako
GPG key ID: 3FD715D87D7725E0

View file

@ -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,
}),
], ],
}) })
} }