Revert "🐛 fix(panel): reduce icon size and hide battery indicator when no battery is detected"

This reverts commit c33adef98b.
This commit is contained in:
sankalp committed 2025-08-10 22:47:13 +05:45
1 parent 2e8e3e73e2
commit 3b119e7474
1 file changed
+7 -10
+7 -10
View File
@@ -434,13 +434,10 @@ class BatteryIndicator(Box):
def update_state(self):
if not self.battery_service.is_present:
# Hide the entire battery component when no battery is present
self.set_visible(False)
return
icon_file = "battery.svg"
tooltip = "No battery detected"
percentage_text = "N/A"
else:
# Show the battery component when battery is present
self.set_visible(True)
percentage = self.battery_service.percentage
state = self.battery_service.state
is_charging = state in ["CHARGING", "FULLY_CHARGED"]
@@ -451,10 +448,10 @@ class BatteryIndicator(Box):
tooltip = self.get_battery_tooltip(percentage, state)
percentage_text = f"{percentage}%"
# Update icon, tooltip, and percentage label
self.battery_icon.set_from_file(get_relative_path(icon_file))
self.battery_button.set_tooltip_text(tooltip)
self.battery_label.set_label(percentage_text)
# Update icon, tooltip, and percentage label
self.battery_icon.set_from_file(get_relative_path(icon_file))
self.battery_button.set_tooltip_text(tooltip)
self.battery_label.set_label(percentage_text)
def on_battery_clicked(self, *args):
"""Handle Battery indicator click"""