mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(Bar): handle widget size changes
This commit is contained in:
@ -10,7 +10,7 @@ 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 &format, uint16_t interval = 0);
|
||||
virtual ~ALabel();
|
||||
virtual auto update() -> void;
|
||||
virtual std::string getIcon(uint16_t, const std::string &alt = "");
|
||||
|
@ -56,7 +56,7 @@ class Bar {
|
||||
void setupAltFormatKeyForModuleList(const char *module_list_name);
|
||||
|
||||
uint32_t width_ = 0;
|
||||
uint32_t height_ = 30;
|
||||
uint32_t height_ = 1;
|
||||
Gtk::Box left_;
|
||||
Gtk::Box center_;
|
||||
Gtk::Box right_;
|
||||
|
@ -25,10 +25,10 @@ class Client {
|
||||
std::vector<std::unique_ptr<Bar>> bars;
|
||||
|
||||
private:
|
||||
Client();
|
||||
Client() = default;
|
||||
void setupConfigs(const std::string &config, const std::string &style);
|
||||
void bindInterfaces();
|
||||
const std::string getValidPath(std::vector<std::string> paths);
|
||||
const std::string getValidPath(const std::vector<std::string> &paths);
|
||||
void handleOutput(std::unique_ptr<struct waybar_output> &output);
|
||||
bool isValidOutput(const Json::Value &config, std::unique_ptr<struct waybar_output> &output);
|
||||
auto setupConfig() -> void;
|
||||
|
@ -20,7 +20,7 @@ namespace waybar::modules::SNI {
|
||||
|
||||
class Item : public sigc::trackable {
|
||||
public:
|
||||
Item(std::string, std::string, const Json::Value&);
|
||||
Item(const std::string&, const std::string&, const Json::Value&);
|
||||
~Item() = default;
|
||||
|
||||
std::string bus_name;
|
||||
@ -58,7 +58,7 @@ class Item : public sigc::trackable {
|
||||
|
||||
void updateImage();
|
||||
Glib::RefPtr<Gdk::Pixbuf> extractPixBuf(GVariant* variant);
|
||||
Glib::RefPtr<Gdk::Pixbuf> getIconByName(std::string name, int size);
|
||||
Glib::RefPtr<Gdk::Pixbuf> getIconByName(const std::string& name, int size);
|
||||
static void onMenuDestroyed(Item* self);
|
||||
bool makeMenu(GdkEventButton* const& ev);
|
||||
bool handleClick(GdkEventButton* const& /*ev*/);
|
||||
|
@ -24,8 +24,8 @@ class Ipc {
|
||||
Json::Value payload;
|
||||
};
|
||||
|
||||
sigc::signal<void, const struct ipc_response> signal_event;
|
||||
sigc::signal<void, const struct ipc_response> signal_cmd;
|
||||
sigc::signal<void, const struct ipc_response&> signal_event;
|
||||
sigc::signal<void, const struct ipc_response&> signal_cmd;
|
||||
|
||||
void sendCmd(uint32_t type, const std::string &payload = "");
|
||||
void subscribe(const std::string &payload);
|
||||
|
@ -16,7 +16,7 @@ class Mode : public ALabel {
|
||||
auto update() -> void;
|
||||
|
||||
private:
|
||||
void onEvent(const struct Ipc::ipc_response);
|
||||
void onEvent(const struct Ipc::ipc_response&);
|
||||
void worker();
|
||||
|
||||
const Bar& bar_;
|
||||
|
@ -17,10 +17,10 @@ class Window : public ALabel {
|
||||
auto update() -> void;
|
||||
|
||||
private:
|
||||
void onEvent(const struct Ipc::ipc_response);
|
||||
void onCmd(const struct Ipc::ipc_response);
|
||||
void onEvent(const struct Ipc::ipc_response&);
|
||||
void onCmd(const struct Ipc::ipc_response&);
|
||||
void worker();
|
||||
std::tuple<int, std::string> getFocusedNode(Json::Value nodes);
|
||||
std::tuple<int, std::string> getFocusedNode(const Json::Value& nodes);
|
||||
void getFocusedWindow();
|
||||
|
||||
const Bar& bar_;
|
||||
|
@ -19,8 +19,8 @@ class Workspaces : public IModule {
|
||||
operator Gtk::Widget&();
|
||||
|
||||
private:
|
||||
void onCmd(const struct Ipc::ipc_response);
|
||||
void onEvent(const struct Ipc::ipc_response);
|
||||
void onCmd(const struct Ipc::ipc_response&);
|
||||
void onEvent(const struct Ipc::ipc_response&);
|
||||
void worker();
|
||||
bool filterButtons();
|
||||
Gtk::Button& addButton(const Json::Value&);
|
||||
|
Reference in New Issue
Block a user