mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor(modules): const bar
This commit is contained in:
@ -26,7 +26,6 @@ class Bar {
|
||||
std::string output_name;
|
||||
uint32_t wl_name;
|
||||
bool visible = true;
|
||||
uint32_t nb_tray_hosts = 0;
|
||||
private:
|
||||
static void handleLogicalPosition(void *, struct zxdg_output_v1 *, int32_t,
|
||||
int32_t);
|
||||
|
@ -27,10 +27,10 @@ class Bar;
|
||||
|
||||
class Factory {
|
||||
public:
|
||||
Factory(Bar& bar, const Json::Value& config);
|
||||
Factory(const Bar& bar, const Json::Value& config);
|
||||
IModule* makeModule(const std::string &name) const;
|
||||
private:
|
||||
Bar& bar_;
|
||||
const Bar& bar_;
|
||||
const Json::Value& config_;
|
||||
};
|
||||
|
||||
|
@ -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