1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

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

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
},
);