Merge pull request #819 from pedrocr/sway-workspaces-id

Add IDs to sway workspace buttons for CSS styling
This commit is contained in:
Alex 2020-08-13 13:17:30 +02:00 committed by GitHub
commit 51a66d5919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -139,3 +139,4 @@ n.b.: the list of outputs can be obtained from command line using *swaymsg -t ge
- *#workspaces button.urgent* - *#workspaces button.urgent*
- *#workspaces button.persistent* - *#workspaces button.persistent*
- *#workspaces button.current_output* - *#workspaces button.current_output*
- *#workspaces button#sway-workspace-${name}

View File

@ -248,6 +248,7 @@ Gtk::Button &Workspaces::addButton(const Json::Value &node) {
auto pair = buttons_.emplace(node["name"].asString(), node["name"].asString()); auto pair = buttons_.emplace(node["name"].asString(), node["name"].asString());
auto &&button = pair.first->second; auto &&button = pair.first->second;
box_.pack_start(button, false, false, 0); box_.pack_start(button, false, false, 0);
button.set_name("sway-workspace-" + node["name"].asString());
button.set_relief(Gtk::RELIEF_NONE); button.set_relief(Gtk::RELIEF_NONE);
if (!config_["disable-click"].asBool()) { if (!config_["disable-click"].asBool()) {
button.signal_pressed().connect([this, node] { button.signal_pressed().connect([this, node] {