feat(workspaces): add urgent, visible class

This commit is contained in:
Alexis 2018-08-15 15:03:51 +02:00
parent 52e7b6148b
commit be66cc2dd1
3 changed files with 17 additions and 4 deletions

View File

@ -13,6 +13,7 @@
- Memory
- Cpu load average
- Custom scripts
- And much more customizations
**Configuration and Customization**

View File

@ -22,7 +22,7 @@ window {
font-size: 10px;
}
#workspaces button.current {
#workspaces button.focused {
background: #64727D;
border-bottom: 3px solid white;
}

View File

@ -53,9 +53,17 @@ auto waybar::modules::Workspaces::update() -> void
} else {
auto &button = it->second;
if (node["focused"].asBool())
button.get_style_context()->add_class("current");
button.get_style_context()->add_class("focused");
else
button.get_style_context()->remove_class("current");
button.get_style_context()->remove_class("focused");
if (node["visible"].asBool())
button.get_style_context()->add_class("visible");
else
button.get_style_context()->remove_class("visible");
if (node["urgent"].asBool())
button.get_style_context()->add_class("urgent");
else
button.get_style_context()->remove_class("urgent");
if (needReorder)
_box.reorder_child(button, node["num"].asInt());
button.show();
@ -89,7 +97,11 @@ void waybar::modules::Workspaces::_addWorkspace(Json::Value node)
.connect(sigc::mem_fun(*this, &Workspaces::_handleScroll));
_box.reorder_child(button, node["num"].asInt());
if (node["focused"].asBool())
button.get_style_context()->add_class("current");
button.get_style_context()->add_class("focused");
if (node["visible"].asBool())
button.get_style_context()->add_class("visible");
if (node["urgent"].asBool())
button.get_style_context()->add_class("urgent");
button.show();
}