make rounding in function not individually.

This commit is contained in:
Turann_
2026-02-01 00:56:41 +03:00
parent 53c7e85acc
commit ad848c8a61
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -20,7 +20,7 @@ Singleton {
readonly property bool batteryPluggedIn: isPluggedIn(primaryDevice)
readonly property bool batteryReady: isDeviceReady(primaryDevice)
readonly property bool batteryPresent: isDevicePresent(primaryDevice)
readonly property string batteryIcon: getIcon(Math.round(batteryPercentage), batteryCharging, batteryPluggedIn, batteryReady)
readonly property string batteryIcon: getIcon(batteryPercentage, batteryCharging, batteryPluggedIn, batteryReady)
readonly property var laptopBatteries: UPower.devices.values.filter(d => d.isLaptopBattery)
readonly property var bluetoothBatteries: {
@@ -116,9 +116,9 @@ Singleton {
return -1;
}
if (device.batteryAvailable !== undefined) {
return (device.battery || 0) * 100;
return Math.round((device.battery || 0) * 100);
}
return (device.percentage || 0) * 100;
return Math.round((device.percentage || 0) * 100);
}
function isCharging(device) {