mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-20 01:42:38 +02:00
refactor(modules): const bar
This commit is contained in:
@@ -12,13 +12,14 @@ namespace waybar::modules::SNI {
|
||||
|
||||
class Tray : public IModule {
|
||||
public:
|
||||
Tray(Bar& bar, const Json::Value&);
|
||||
Tray(const Bar& bar, const Json::Value&);
|
||||
auto update() -> void;
|
||||
operator Gtk::Widget &();
|
||||
private:
|
||||
void onAdd(std::unique_ptr<Item>& item);
|
||||
void onRemove(std::unique_ptr<Item>& item);
|
||||
|
||||
static inline std::size_t nb_hosts_ = 0;
|
||||
std::thread thread_;
|
||||
const Json::Value& config_;
|
||||
Gtk::Box box_;
|
||||
|
@@ -12,12 +12,12 @@ namespace waybar::modules::sway {
|
||||
|
||||
class Mode : public ALabel {
|
||||
public:
|
||||
Mode(waybar::Bar&, const Json::Value&);
|
||||
Mode(const waybar::Bar&, const Json::Value&);
|
||||
auto update() -> void;
|
||||
private:
|
||||
void worker();
|
||||
|
||||
Bar& bar_;
|
||||
const Bar& bar_;
|
||||
waybar::util::SleeperThread thread_;
|
||||
util::JsonParser parser_;
|
||||
Ipc ipc_;
|
||||
|
@@ -13,14 +13,14 @@ namespace waybar::modules::sway {
|
||||
|
||||
class Window : public ALabel {
|
||||
public:
|
||||
Window(waybar::Bar&, const Json::Value&);
|
||||
Window(const waybar::Bar&, const Json::Value&);
|
||||
auto update() -> void;
|
||||
private:
|
||||
void worker();
|
||||
std::tuple<int, std::string> getFocusedNode(Json::Value nodes);
|
||||
void getFocusedWindow();
|
||||
|
||||
Bar& bar_;
|
||||
const Bar& bar_;
|
||||
waybar::util::SleeperThread thread_;
|
||||
util::JsonParser parser_;
|
||||
Ipc ipc_;
|
||||
|
@@ -12,7 +12,7 @@ namespace waybar::modules::sway {
|
||||
|
||||
class Workspaces : public IModule {
|
||||
public:
|
||||
Workspaces(waybar::Bar&, const Json::Value&);
|
||||
Workspaces(const waybar::Bar&, const Json::Value&);
|
||||
auto update() -> void;
|
||||
operator Gtk::Widget &();
|
||||
private:
|
||||
@@ -23,7 +23,7 @@ class Workspaces : public IModule {
|
||||
std::string getPrevWorkspace();
|
||||
std::string getNextWorkspace();
|
||||
|
||||
Bar& bar_;
|
||||
const Bar& bar_;
|
||||
const Json::Value& config_;
|
||||
waybar::util::SleeperThread thread_;
|
||||
Gtk::Box box_;
|
||||
|
Reference in New Issue
Block a user