Turn off text wrapping by default in combo-box popups (#3912)

This trips up a lot of users
This commit is contained in:
Emil Ernerfeldt 2024-01-29 16:09:54 +01:00 committed by GitHub
parent 13b59fb0d4
commit 1d1b07c6b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 1 deletions

View File

@ -365,7 +365,15 @@ fn combo_box_dyn<'c, R>(
|ui| {
ScrollArea::vertical()
.max_height(height)
.show(ui, menu_contents)
.show(ui, |ui| {
// Often the button is very narrow, which means this popup
// is also very narrow. Having wrapping on would therefore
// result in labels that wrap very early.
// Instead, we turn it off by default so that the labels
// expand the width of the menu.
ui.style_mut().wrap = Some(false);
menu_contents(ui)
})
.inner
},
);