mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor: move label name and id to label contructor
This commit is contained in:
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user