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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user