upower: Add 'low' and 'critical' CSS classes

Add secondary CSS class based on the 'warning_level' field reported by UPower
over D-Bus.  This makes it possible to add custom styling when the battery is
near empty.
This commit is contained in:
Bartel Sielski
2024-03-18 11:47:43 +01:00
parent 2c927de4c6
commit bd8b215416
2 changed files with 23 additions and 1 deletions

View File

@ -71,6 +71,7 @@ class UPower : public AModule {
GDBusConnection *login1_connection;
std::unique_ptr<UPowerTooltip> upower_tooltip;
std::string lastStatus;
const char *lastWarningLevel;
bool showAltText;
bool showIcon = true;
bool upowerRunning;