1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Add workaround for max_width

set_max_width and set_max_height will limit intrinsic size but not max_rect itself
This commit is contained in:
lucasmerlin
2025-03-19 11:51:03 +01:00
parent ceb78780de
commit d72e85b6b4
3 changed files with 24 additions and 3 deletions

View File

@@ -89,12 +89,13 @@ fn main() -> eframe::Result {
MenuButton::new("Menu")
.config(MenuConfig::new().close_behavior(PopupCloseBehavior::CloseOnClickOutside))
.ui(ui, |ui| {
// ui.set_max_width(180.0);
ui.set_max_width(180.0);
if ui.button("Close menu").clicked() {
ui.close_menu();
}
ui.collapsing("Collapsing", |ui| {
egui::ScrollArea::both().show(ui, |ui| {
// ui.set_width(ui.available_width());
for _ in 0..10 {
ui.label(
"This is a long text label containing \