Merge pull request #2916 from alttabber/master

Add style classes for hyprland/submap
This commit is contained in:
Alexis Rouillard 2024-02-13 13:25:23 +01:00 committed by GitHub
commit 28cd9dff47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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();