From ef2bacc4c40dcf8b2afe3b737e1f7c28aca477e0 Mon Sep 17 00:00:00 2001 From: JPratama7 Date: Sat, 26 Jul 2025 22:15:03 +0700 Subject: [PATCH] fix: update battery tooltip to reference correct widget properties --- Bar/Modules/Battery.qml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Bar/Modules/Battery.qml b/Bar/Modules/Battery.qml index fe66910..6ca0848 100644 --- a/Bar/Modules/Battery.qml +++ b/Bar/Modules/Battery.qml @@ -61,17 +61,17 @@ Item { id: batteryTooltip text: { let lines = []; - if (isReady) { - lines.push(charging ? "Charging" : "Discharging"); - lines.push(Math.round(percent) + "%"); - if (battery.changeRate !== undefined) - lines.push("Rate: " + battery.changeRate.toFixed(2) + " W"); - if (battery.timeToEmpty > 0) - lines.push("Time left: " + Math.floor(battery.timeToEmpty / 60) + " min"); - if (battery.timeToFull > 0) - lines.push("Time to full: " + Math.floor(battery.timeToFull / 60) + " min"); - if (battery.healthPercentage !== undefined) - lines.push("Health: " + Math.round(battery.healthPercentage) + "%"); + if (batteryWidget.isReady) { + lines.push(batteryWidget.charging ? "Charging" : "Discharging"); + lines.push(Math.round(batteryWidget.percent) + "%"); + if (batteryWidget.battery.changeRate !== undefined) + lines.push("Rate: " + batteryWidget.battery.changeRate.toFixed(2) + " W"); + if (batteryWidget.battery.timeToEmpty > 0) + lines.push("Time left: " + Math.floor(batteryWidget.battery.timeToEmpty / 60) + " min"); + if (batteryWidget.battery.timeToFull > 0) + lines.push("Time to full: " + Math.floor(batteryWidget.battery.timeToFull / 60) + " min"); + if (batteryWidget.battery.healthPercentage !== undefined) + lines.push("Health: " + Math.round(batteryWidget.battery.healthPercentage) + "%"); } return lines.join("\n"); }