Scrollbars autohide, select fix for reselecting current item closing popup - #25057
Conversation
| && let Ok((gutter, mut node)) = q_gutters.get_mut(child_of.parent()) | ||
| { | ||
| let padding = if overflows { gutter.0 } else { Val::ZERO }; | ||
| if node.padding.right != padding { |
There was a problem hiding this comment.
I would suggest adding a clarifying note here, as this makes certain assumptions about the layout structure of the parent container - those assumptions are true in the case of feathers, but may not be true for non-feathers widgets generally.
For example, a headless scrollbar can be placed in a grid, a flexbox, or it can float on top as a separate layer. For a floating scrollbar, altering the padding of the parent wouldn't be the right move.
Also, the above code appears to handle both horizontal and vertical scrollbars, but I would think that adjusting the right padding would only work for vertical scrollbars.
There was a problem hiding this comment.
good spot, thanks. will add comment to make clear ScrollbarGutter is just for padding based ones and fix horizontal.
… also added comment on gutter to make clear its only for padding based scrollbars
…popup (bevyengine#25057) # Objective / Solution - Select control didn't close when reselecting the current item (mouse or keyboard), because that doesn't send an event from underlying widget (list). Added a new event ReselectListRow to bevy_ui_widget and send that, picked it up in select to close the select. - Scrollbar was hugging the right side of the popup too much so added some padding on it. - Scrollbar was visible whether content fitted or not. Added an auto_hide (default to true). ## Solution `cargo run --example feathers_gallery --features bevy_feathers` --- ## Showcase Select where all items fit: <img width="283" height="94" alt="image" src="https://github.com/user-attachments/assets/c37d827b-adc5-43f5-be32-d2420d65b668" /> Select where they don't: <img width="281" height="161" alt="image" src="https://github.com/user-attachments/assets/3b7a09e6-8755-46c1-88c7-5d51766000de" /> --------- Co-authored-by: John Payne <20407779+johngpayne@users.noreply.github.com>
…popup (bevyengine#25057) # Objective / Solution - Select control didn't close when reselecting the current item (mouse or keyboard), because that doesn't send an event from underlying widget (list). Added a new event ReselectListRow to bevy_ui_widget and send that, picked it up in select to close the select. - Scrollbar was hugging the right side of the popup too much so added some padding on it. - Scrollbar was visible whether content fitted or not. Added an auto_hide (default to true). ## Solution `cargo run --example feathers_gallery --features bevy_feathers` --- ## Showcase Select where all items fit: <img width="283" height="94" alt="image" src="https://github.com/user-attachments/assets/c37d827b-adc5-43f5-be32-d2420d65b668" /> Select where they don't: <img width="281" height="161" alt="image" src="https://github.com/user-attachments/assets/3b7a09e6-8755-46c1-88c7-5d51766000de" /> --------- Co-authored-by: John Payne <20407779+johngpayne@users.noreply.github.com>



Objective / Solution
Solution
cargo run --example feathers_gallery --features bevy_feathersShowcase
Select where all items fit:
Select where they don't: