feat(Bar): handle widget size changes

This commit is contained in:
Alex
2019-04-24 12:37:24 +02:00
parent 90d89fe974
commit 311c34ecbc
28 changed files with 175 additions and 137 deletions

View File

@ -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*/);

View File

@ -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);

View File

@ -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_;

View File

@ -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_;

View File

@ -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&);