mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
feat(workspaces): add class to button when label is a icon
This commit is contained in:
parent
c3bd6da1d0
commit
52e7b6148b
@ -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 {
|
||||
|
@ -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] {
|
||||
|
Loading…
Reference in New Issue
Block a user