1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 22:30:03 -04:00

Experiment with calculating an Ui's "intrinsic size" by remembering the widget's size

This commit is contained in:
Lucas Meurer
2025-03-02 11:48:37 +01:00
parent 962c7c7516
commit 80d218cf71
8 changed files with 87 additions and 16 deletions

View File

@@ -70,6 +70,18 @@ fn nested_menus(ui: &mut egui::Ui, checked: &mut bool) {
}
let _ = ui.button("Item");
ui.menu_button("Recursive", |ui| nested_menus(ui, checked));
// if ui.button(if *checked { "short" } else { "Very long text for this item that should be wrapped" }).clicked() {
// *checked = !*checked;
// }
ui.checkbox(
checked,
if *checked {
"short"
} else {
"Very long text for this item that should be wrapped"
},
);
});
ui.menu_button("SubMenu", |ui| {
if ui.button("Open…").clicked() {