mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(ALabel): Toggleable labels
This commit is contained in:
@ -7,13 +7,20 @@ namespace waybar {
|
||||
|
||||
class ALabel : public IModule {
|
||||
public:
|
||||
ALabel(const Json::Value&);
|
||||
ALabel(const Json::Value&, const std::string format);
|
||||
virtual ~ALabel() = default;
|
||||
virtual auto update() -> void;
|
||||
virtual std::string getIcon(uint16_t percentage);
|
||||
virtual operator Gtk::Widget &();
|
||||
protected:
|
||||
Gtk::EventBox event_box_;
|
||||
Gtk::Label label_;
|
||||
const Json::Value& config_;
|
||||
std::string format_;
|
||||
private:
|
||||
bool handleToggle(GdkEventButton* const& ev);
|
||||
bool alt = false;
|
||||
const std::string default_format_;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ class Battery : public ALabel {
|
||||
static inline const fs::path data_dir_ = "/sys/class/power_supply/";
|
||||
|
||||
void worker();
|
||||
std::string getIcon(uint16_t percentage);
|
||||
|
||||
util::SleeperThread thread_;
|
||||
std::vector<fs::path> batteries_;
|
||||
|
@ -19,8 +19,6 @@ class Pulseaudio : public ALabel {
|
||||
static void sinkInfoCb(pa_context*, const pa_sink_info*, int, void*);
|
||||
static void serverInfoCb(pa_context*, const pa_server_info*, void*);
|
||||
|
||||
std::string getIcon(uint16_t);
|
||||
|
||||
pa_threaded_mainloop* mainloop_;
|
||||
pa_mainloop_api* mainloop_api_;
|
||||
pa_context* context_;
|
||||
|
Reference in New Issue
Block a user