feat(workspaces): add class to button when label is a icon

This commit is contained in:
Alexis 2018-08-15 14:58:55 +02:00
parent c3bd6da1d0
commit 52e7b6148b
2 changed files with 7 additions and 5 deletions

View File

@ -12,14 +12,14 @@ window {
}
#workspaces button {
padding: 0 8px;
padding: 0 5px;
background: transparent;
color: white;
border-bottom: 3px solid transparent;
}
#workspaces button label {
font-size: 12px;
#workspaces button.icon label {
font-size: 10px;
}
#workspaces button.current {

View File

@ -67,9 +67,11 @@ auto waybar::modules::Workspaces::update() -> void
void waybar::modules::Workspaces::_addWorkspace(Json::Value node)
{
auto pair = _buttons.emplace(node["num"].asInt(),
_getIcon(node["name"].asString()));
auto icon = _getIcon(node["name"].asString());
auto pair = _buttons.emplace(node["num"].asInt(), icon);
auto &button = pair.first->second;
if (icon != node["name"].asString())
button.get_style_context()->add_class("icon");
_box.pack_start(button, false, false, 0);
button.set_relief(Gtk::RELIEF_NONE);
button.signal_clicked().connect([this, pair] {