fix: show bt device batt in sublabel

Sublabel instead of icon
Also animate sublabel
This commit is contained in:
2 * r + 2 * t 2026-06-07 02:59:03 +10:00
parent 76b64ca214
commit 8cc986ce7b

View file

@ -123,20 +123,14 @@ PageBase {
StyledText {
Layout.fillWidth: true
text: device.connected ? qsTr("Connected") : qsTr("Saved")
text: device.connected ? qsTr("Connected%1").arg(device.modelData?.batteryAvailable ? " • " + Math.round(device.modelData.battery * 100) + "%" : "") : qsTr("Saved")
color: Colours.tPalette.m3outline
font: Tokens.font.label.small
elide: Text.ElideRight
animate: true
}
}
MaterialIcon {
visible: device.connected && (device.modelData?.batteryAvailable ?? false)
text: Icons.getBatteryIcon(device.modelData?.battery ?? 0)
color: (device.modelData?.battery ?? 1) < 0.2 ? Colours.palette.m3error : Colours.palette.m3onSurfaceVariant
font: Tokens.font.icon.medium
}
Item {
Layout.fillHeight: true
implicitWidth: height