dashboard: display correct temp units
This commit is contained in:
parent
f0ba90d784
commit
5ab986eba4
1 changed files with 6 additions and 2 deletions
|
|
@ -9,6 +9,10 @@ RowLayout {
|
|||
|
||||
readonly property int padding: Appearance.padding.large
|
||||
|
||||
function displayTemp(temp: real): string {
|
||||
return `${Math.ceil(Config.services.useFahrenheit ? temp * 1.8 + 32 : temp)}°${Config.services.useFahrenheit ? "F" : "C"}`;
|
||||
}
|
||||
|
||||
spacing: Appearance.spacing.large * 3
|
||||
|
||||
Ref {
|
||||
|
|
@ -24,7 +28,7 @@ RowLayout {
|
|||
value1: Math.min(1, SystemUsage.gpuTemp / 90)
|
||||
value2: SystemUsage.gpuPerc
|
||||
|
||||
label1: `${Math.ceil(SystemUsage.gpuTemp)}°C`
|
||||
label1: root.displayTemp(SystemUsage.gpuTemp)
|
||||
label2: `${Math.round(SystemUsage.gpuPerc * 100)}%`
|
||||
|
||||
sublabel1: qsTr("GPU temp")
|
||||
|
|
@ -41,7 +45,7 @@ RowLayout {
|
|||
value1: Math.min(1, SystemUsage.cpuTemp / 90)
|
||||
value2: SystemUsage.cpuPerc
|
||||
|
||||
label1: `${Math.ceil(SystemUsage.cpuTemp)}°C`
|
||||
label1: root.displayTemp(SystemUsage.cpuTemp)
|
||||
label2: `${Math.round(SystemUsage.cpuPerc * 100)}%`
|
||||
|
||||
sublabel1: qsTr("CPU temp")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue