Skip to content

Commit

Permalink
perf: don't update lines if is not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
orblazer committed Apr 27, 2023
1 parent a6f3271 commit f5c52d6
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions package/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,15 @@ Item {
sensorId: "cpu/all/averageTemperature"
}
onShowValueWhenMouseMove: {
secondLineLabel.text = cpuFrequencySensor.formattedValue;
secondLineLabel.visible = true;
thirdLineLabel.text = cpuTempSensor.formattedValue;
thirdLineLabel.color = getCpuTempColor(cpuTempSensor.value);
thirdLineLabel.visible = true;
if (showCpuClock) {
secondLineLabel.text = cpuFrequencySensor.formattedValue;
secondLineLabel.visible = true;
}
if (showCpuTemp) {
thirdLineLabel.text = cpuTempSensor.formattedValue;
thirdLineLabel.color = getCpuTempColor(cpuTempSensor.value);
thirdLineLabel.visible = true;
}
}
}

Expand Down

0 comments on commit f5c52d6

Please sign in to comment.