group: allow replacing the drawer leader when expanded - #5291
Open
bjnobre wants to merge 2 commits into
Open
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.
This change adds the
hide-leader-when-expandedoption to drawer groups.It allows the first module to serve as a compact representation of the drawer's contents. When the drawer expands, the leader is hidden and replaced by the child modules. When the drawer collapses, the leader becomes visible again.
My use case is a media group composed of:
The configuration looks like this:
While collapsed, the group displays only the CAVA visualizer:
When the pointer enters the group, the visualizer is replaced by the media controls:
Without this option, a drawer keeps its first module visible and reveals its children beside it. That is appropriate when the first module is a permanent button or indicator, but it does not support cases where the expanded content is intended to be an alternative view of the same space.
The option defaults to
false, so existing configurations retain their current behavior.The second commit fixes tooltip behavior during this replacement. Hiding the leader changes the widget under a stationary pointer. GTK does not always initiate another tooltip query in that situation, so a newly revealed child's tooltip may not appear until the pointer leaves and enters the group again.
To address this, the group triggers a tooltip query once the drawer's reveal transition has completed. This allows the revealed widget to display its tooltip without repeatedly querying during the animation.
I tested horizontal drawers in both transition directions. When
hide-leader-when-expandedis not configured, existing drawer behavior remains unchanged.