#pragma once #include #include #include #include class BatteryWidget : public Gtk::Box { public: BatteryWidget(); ~BatteryWidget(); private: Gtk::Label iconLabel; Gtk::Label label; sigc::connection timeoutConn; std::filesystem::path batteryPath; std::string currentStateClass; void update(); bool on_timeout(); void find_battery_path(); void set_state_class(const std::string &stateClass); std::string build_icon(int capacity, bool hasBattery, bool charging, bool full) const; std::string build_text(int capacity, const std::string &status, bool hasBattery, bool charging, bool full) const; };