feat(workspaces): add class to button when label is a icon
parent
c3bd6da1d0
commit
52e7b6148b
|
@ -12,14 +12,14 @@ window {
|
||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button {
|
#workspaces button {
|
||||||
padding: 0 8px;
|
padding: 0 5px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: white;
|
color: white;
|
||||||
border-bottom: 3px solid transparent;
|
border-bottom: 3px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button label {
|
#workspaces button.icon label {
|
||||||
font-size: 12px;
|
font-size: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button.current {
|
#workspaces button.current {
|
||||||
|
|
|
@ -67,9 +67,11 @@ auto waybar::modules::Workspaces::update() -> void
|
||||||
|
|
||||||
void waybar::modules::Workspaces::_addWorkspace(Json::Value node)
|
void waybar::modules::Workspaces::_addWorkspace(Json::Value node)
|
||||||
{
|
{
|
||||||
auto pair = _buttons.emplace(node["num"].asInt(),
|
auto icon = _getIcon(node["name"].asString());
|
||||||
_getIcon(node["name"].asString()));
|
auto pair = _buttons.emplace(node["num"].asInt(), icon);
|
||||||
auto &button = pair.first->second;
|
auto &button = pair.first->second;
|
||||||
|
if (icon != node["name"].asString())
|
||||||
|
button.get_style_context()->add_class("icon");
|
||||||
_box.pack_start(button, false, false, 0);
|
_box.pack_start(button, false, false, 0);
|
||||||
button.set_relief(Gtk::RELIEF_NONE);
|
button.set_relief(Gtk::RELIEF_NONE);
|
||||||
button.signal_clicked().connect([this, pair] {
|
button.signal_clicked().connect([this, pair] {
|
||||||
|
|
Loading…
Reference in New Issue