feat(ALabel): Toggleable labels

This commit is contained in:
Alexis
2018-08-27 01:36:25 +02:00
parent e9478f548e
commit 53956d9d18
13 changed files with 75 additions and 63 deletions

View File

@ -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_;
};
}