refactor: move label name and id to label contructor

This commit is contained in:
Alex
2019-05-22 12:06:24 +02:00
parent 97bd637f5d
commit d24d85bebf
16 changed files with 32 additions and 75 deletions

View File

@ -10,7 +10,8 @@ namespace waybar {
class ALabel : public IModule {
public:
ALabel(const Json::Value &, const std::string &format, uint16_t interval = 0);
ALabel(const Json::Value &, const std::string &, const std::string &, const std::string &format,
uint16_t interval = 0);
virtual ~ALabel();
virtual auto update() -> void;
virtual std::string getIcon(uint16_t, const std::string &alt = "", uint16_t max = 0);
@ -29,8 +30,8 @@ class ALabel : public IModule {
bool alt_ = false;
std::string default_format_;
virtual bool handleToggle(GdkEventButton *const &ev);
virtual bool handleScroll(GdkEventScroll *);
virtual bool handleToggle(GdkEventButton *const &ev);
virtual bool handleScroll(GdkEventScroll *);
virtual std::string getState(uint8_t value, bool lesser = false);
private:

View File

@ -47,7 +47,6 @@ class Backlight : public ALabel {
template <class ForwardIt, class Inserter>
static void enumerate_devices(ForwardIt first, ForwardIt last, Inserter inserter, udev *udev);
const std::string name_;
const std::string preferred_device_;
static constexpr int EPOLL_MAX_EVENTS = 16;