fixed discharging vs charging thing because the wiki lies about the rate parameter
This commit is contained in:
@@ -8,8 +8,6 @@ import "../Color.js" as Colors
|
|||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool batteryInUse: root.batteryPresent && root.batteryLaptop
|
|
||||||
property bool batteryLaptop: root.mainBattery.isLaptopBattery
|
|
||||||
property double batteryPercentage: root.mainBattery.percentage
|
property double batteryPercentage: root.mainBattery.percentage
|
||||||
property bool batteryPresent: root.mainBattery.ready
|
property bool batteryPresent: root.mainBattery.ready
|
||||||
property UPowerDevice mainBattery: UPower.displayDevice
|
property UPowerDevice mainBattery: UPower.displayDevice
|
||||||
@@ -69,7 +67,7 @@ Singleton {
|
|||||||
let finalString = "harging at " + rate + "W";
|
let finalString = "harging at " + rate + "W";
|
||||||
if (rate == 0) {
|
if (rate == 0) {
|
||||||
finalString = "Battery Idle";
|
finalString = "Battery Idle";
|
||||||
} else if (rate < 0) {
|
} else if (rate <= 0 || mainBattery.state == UPowerDeviceState.Charging) {
|
||||||
finalString = "C" + finalString;
|
finalString = "C" + finalString;
|
||||||
} else {
|
} else {
|
||||||
finalString = "Disc" + finalString;
|
finalString = "Disc" + finalString;
|
||||||
|
|||||||
Reference in New Issue
Block a user