dashboard: display correct temp units

This commit is contained in:
2 * r + 2 * t 2025-08-04 21:54:25 +10:00
parent f0ba90d784
commit 5ab986eba4

View file

@ -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")