Compare commits
No commits in common. "TagHide" and "master" have entirely different histories.
|
|
@ -33,7 +33,6 @@ class Tags : public waybar::AModule {
|
|||
Gtk::Box box_;
|
||||
std::vector<Gtk::Button> buttons_;
|
||||
struct zriver_output_status_v1 *output_status_;
|
||||
bool hide_unoccupied;
|
||||
};
|
||||
|
||||
} /* namespace waybar::modules::river */
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <wayland-client.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
|
||||
#include "client.hpp"
|
||||
#include "xdg-output-unstable-v1-client-protocol.h"
|
||||
|
|
@ -108,8 +107,6 @@ Tags::Tags(const std::string &id, const waybar::Bar &bar, const Json::Value &con
|
|||
spdlog::error("wl_seat not advertised");
|
||||
}
|
||||
|
||||
hide_unoccupied = config_["hide-unoccupied"].asBool();
|
||||
|
||||
box_.set_name("tags");
|
||||
if (!id.empty()) {
|
||||
box_.get_style_context()->add_class(id);
|
||||
|
|
@ -142,12 +139,7 @@ Tags::Tags(const std::string &id, const waybar::Bar &bar, const Json::Value &con
|
|||
button.signal_button_press_event().connect(
|
||||
sigc::bind(sigc::mem_fun(*this, &Tags::handle_button_press), i));
|
||||
}
|
||||
if ( hide_unoccupied ) {
|
||||
button.hide();
|
||||
}
|
||||
else {
|
||||
button.show();
|
||||
}
|
||||
button.show();
|
||||
i <<= 1;
|
||||
}
|
||||
|
||||
|
|
@ -194,18 +186,8 @@ void Tags::handle_focused_tags(uint32_t tags) {
|
|||
for (auto &button : buttons_) {
|
||||
if ((1 << i) & tags) {
|
||||
button.get_style_context()->add_class("focused");
|
||||
button.show();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
button.get_style_context()->remove_class("focused");
|
||||
if (hide_unoccupied) {
|
||||
if (button.get_style_context()->has_class("occupied")) {
|
||||
button.show();
|
||||
}
|
||||
else {
|
||||
button.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
|
@ -215,9 +197,6 @@ void Tags::handle_view_tags(struct wl_array *view_tags) {
|
|||
// First clear all occupied state
|
||||
for (auto &button : buttons_) {
|
||||
button.get_style_context()->remove_class("occupied");
|
||||
if (hide_unoccupied) {
|
||||
button.hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Set tags with a view to occupied
|
||||
|
|
@ -227,9 +206,6 @@ void Tags::handle_view_tags(struct wl_array *view_tags) {
|
|||
for (auto &button : buttons_) {
|
||||
if (*tags & (1 << i)) {
|
||||
button.get_style_context()->add_class("occupied");
|
||||
if (hide_unoccupied) {
|
||||
button.show();
|
||||
}
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user