2018-08-18 09:43:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <json/json.h>
|
|
|
|
#include "IModule.hpp"
|
|
|
|
|
|
|
|
namespace waybar {
|
|
|
|
|
|
|
|
class ALabel : public IModule {
|
|
|
|
public:
|
2018-08-26 23:36:25 +00:00
|
|
|
ALabel(const Json::Value&, const std::string format);
|
2018-08-18 13:05:18 +00:00
|
|
|
virtual ~ALabel() = default;
|
2018-08-18 09:43:48 +00:00
|
|
|
virtual auto update() -> void;
|
2018-08-29 21:50:41 +00:00
|
|
|
virtual std::string getIcon(uint16_t, const std::string& alt = "");
|
2018-08-18 09:43:48 +00:00
|
|
|
virtual operator Gtk::Widget &();
|
|
|
|
protected:
|
2018-08-26 23:36:25 +00:00
|
|
|
Gtk::EventBox event_box_;
|
2018-08-18 09:43:48 +00:00
|
|
|
Gtk::Label label_;
|
2018-08-20 12:50:45 +00:00
|
|
|
const Json::Value& config_;
|
2018-08-26 23:36:25 +00:00
|
|
|
std::string format_;
|
|
|
|
private:
|
|
|
|
bool handleToggle(GdkEventButton* const& ev);
|
|
|
|
bool alt = false;
|
|
|
|
const std::string default_format_;
|
2018-08-18 09:43:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|