fix: show bt device batt in sublabel
Sublabel instead of icon Also animate sublabel
This commit is contained in:
parent
76b64ca214
commit
8cc986ce7b
1 changed files with 2 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue