mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 14:42:29 +02:00
hyprland/workspaces: Add "empty" icon and class
This commit is contained in:
@ -328,7 +328,8 @@ void Workspace::update(const std::string &format, const std::string &icon) {
|
|||||||
auto style_context = button_.get_style_context();
|
auto style_context = button_.get_style_context();
|
||||||
add_or_remove_class(style_context, active(), "active");
|
add_or_remove_class(style_context, active(), "active");
|
||||||
add_or_remove_class(style_context, is_special(), "special");
|
add_or_remove_class(style_context, is_special(), "special");
|
||||||
add_or_remove_class(style_context, is_empty(), "persistent");
|
add_or_remove_class(style_context, is_empty(), "empty");
|
||||||
|
add_or_remove_class(style_context, is_persistent(), "persistent");
|
||||||
add_or_remove_class(style_context, is_urgent(), "urgent");
|
add_or_remove_class(style_context, is_urgent(), "urgent");
|
||||||
|
|
||||||
label_.set_markup(fmt::format(fmt::runtime(format), fmt::arg("id", id()),
|
label_.set_markup(fmt::format(fmt::runtime(format), fmt::arg("id", id()),
|
||||||
@ -394,6 +395,13 @@ std::string &Workspace::select_icon(std::map<std::string, std::string> &icons_ma
|
|||||||
return named_icon_it->second;
|
return named_icon_it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_empty()) {
|
||||||
|
auto empty_icon_it = icons_map.find("empty");
|
||||||
|
if (empty_icon_it != icons_map.end()) {
|
||||||
|
return empty_icon_it->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (is_persistent()) {
|
if (is_persistent()) {
|
||||||
auto persistent_icon_it = icons_map.find("persistent");
|
auto persistent_icon_it = icons_map.find("persistent");
|
||||||
if (persistent_icon_it != icons_map.end()) {
|
if (persistent_icon_it != icons_map.end()) {
|
||||||
|
Reference in New Issue
Block a user