deine cousine 4. grades
This commit is contained in:
26
include/widgets/battery.hpp
Normal file
26
include/widgets/battery.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <sigc++/connection.h>
|
||||
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user