feat(group): Add .empty class to empty groups#4941
Open
sjudin wants to merge 2 commits intoAlexays:masterfrom
Open
feat(group): Add .empty class to empty groups#4941sjudin wants to merge 2 commits intoAlexays:masterfrom
sjudin wants to merge 2 commits intoAlexays:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Add .empty class to groups if they contain no modules
The use-case for this is when having groups that contain things related to battery/backlight which is not available on a desktop, in that case it would be nice to be able to detect that the group is empty and hide it.
Also add configuration
empty-if-drawer-emptyparameter to control if a drawer should count as empty if only the "main" module could be loaded, this is useful if you have an icon or something similar which always loads and you want to hide the group when drawer children were not able to.If all drawer children are hidden or missing, the group dynamically receives the .empty CSS class.
This is completely event-driven using GTK signals (property_visible().signal_changed()) hooked into Group::update().
Because Waybar shouldn't enforce hiding policies natively, this simply applies the class, leaving it up to the user to define how the .empty group should behave in their style.css.