Hide unavailable health/temp data

This commit is contained in:
Matti Viljanen 2021-05-23 14:25:24 +03:00
parent 645d919457
commit c6f9000aa9

View file

@ -177,10 +177,12 @@ Page {
MyDetailItem {
label: qsTr("Health:")
value: healthText[battery.health]
visible: value !== "unknown"
}
MyDetailItem {
label: qsTr("Temperature:")
value: battery.temperature === 0x7FFFFFFF ? healthText["unknown"] : formatTemperature(battery.temperature)
visible: battery.temperature !== 0x7FFFFFFF
function formatTemperature(temp) {
if(Qt.locale().measurementSystem === Locale.ImperialUSSystem) {