Hide unavailable health/temp data
This commit is contained in:
parent
645d919457
commit
c6f9000aa9
1 changed files with 2 additions and 0 deletions
|
@ -177,10 +177,12 @@ Page {
|
||||||
MyDetailItem {
|
MyDetailItem {
|
||||||
label: qsTr("Health:")
|
label: qsTr("Health:")
|
||||||
value: healthText[battery.health]
|
value: healthText[battery.health]
|
||||||
|
visible: value !== "unknown"
|
||||||
}
|
}
|
||||||
MyDetailItem {
|
MyDetailItem {
|
||||||
label: qsTr("Temperature:")
|
label: qsTr("Temperature:")
|
||||||
value: battery.temperature === 0x7FFFFFFF ? healthText["unknown"] : formatTemperature(battery.temperature)
|
value: battery.temperature === 0x7FFFFFFF ? healthText["unknown"] : formatTemperature(battery.temperature)
|
||||||
|
visible: battery.temperature !== 0x7FFFFFFF
|
||||||
|
|
||||||
function formatTemperature(temp) {
|
function formatTemperature(temp) {
|
||||||
if(Qt.locale().measurementSystem === Locale.ImperialUSSystem) {
|
if(Qt.locale().measurementSystem === Locale.ImperialUSSystem) {
|
||||||
|
|
Loading…
Reference in a new issue