feat(src/window/panel): add persistent battery, network and bluetooth indicators with visibility handling and improve dropdown and config-driven layout logic

The refactor introduces persistent indicator widgets and updates how visibility and layout are managed based on configuration changes.

New Features
- Added BatteryIndicator, NetworkIndicator and BluetoothIndicator as persistent panel children.
- Implemented visibility toggling for each indicator according to configuration and battery presence.
- Added debug prints when an indicator’s visibility changes or a battery is not detected.

Enhancements
- Updated dropdown actions to use `get_about_window()` and `get_settings_window()` for About and System Settings entries.
- Switched layout rebuilding to use `get_config_all()` and now only rebuilds when specific keys actually change.
- Removed manual recreation of indicators; visibility is controlled via `show()`/`set_visible()`.
- Consolidated changed‑key detection and added logging of rebuild reasons.
- Streamlined config key checks to use `config_data.get(..., True)`.

Bug Fixes
- Fixed BatteryIndicator to hide and log when no battery is detected.
- Corrected use of `config_data.get()` with appropriate fallback values.
- Updated layout updates to use `show()` and trigger a resize queue instead of `show_all()`.
This commit is contained in:
sankalp committed 2026-05-03 22:06:42 +05:45
1 parent 704c8b229c
commit be308191c5
3 files changed
+76 -39

No files matched your search

@@ -432,6 +432,7 @@ class BatteryIndicator(Box):
def update_state(self):
if not self._is_present():
print("[Battery] No battery detected, hiding indicator")
self.set_visible(False)
return
else: