Add style classes for hyprland/submap

pull/2916/head
alttabber 2024-02-13 11:42:09 +01:00
parent 2c244b5e83
commit 77c7b91b40
2 changed files with 9 additions and 0 deletions

View File

@ -80,3 +80,4 @@ Addressed by *hyprland/submap*
# STYLE
- *#submap*
- *#submap.<name>*

View File

@ -54,8 +54,16 @@ void Submap::onEvent(const std::string& ev) {
auto submapName = ev.substr(ev.find_last_of('>') + 1);
submapName = waybar::util::sanitize_string(submapName);
if (!submap_.empty()){
label_.get_style_context()->remove_class(submap_);
}
submap_ = submapName;
label_.get_style_context()->add_class(submap_);
spdlog::debug("hyprland submap onevent with {}", submap_);
dp.emit();