mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 07:10:04 -04:00
Fixes after update
This commit is contained in:
@@ -255,11 +255,12 @@ impl<'a> AtomLayout<'a> {
|
||||
let desired_size = Vec2::new(desired_width, height);
|
||||
let frame_size = (desired_size + margin.sum()).at_least(min_size);
|
||||
|
||||
let (_, rect) = ui.allocate_space(frame_size);
|
||||
let intrinsic_size =
|
||||
(Vec2::new(preferred_width, preferred_height) + margin.sum()).at_least(min_size);
|
||||
let (_, rect) = ui.allocate_space(frame_size, intrinsic_size);
|
||||
let mut response = ui.interact(rect, id, sense);
|
||||
|
||||
response.intrinsic_size =
|
||||
Some((Vec2::new(preferred_width, preferred_height) + margin.sum()).at_least(min_size));
|
||||
response.intrinsic_size = Some(intrinsic_size);
|
||||
|
||||
AllocatedAtomLayout {
|
||||
sized_atoms: sized_items,
|
||||
|
||||
@@ -42,12 +42,13 @@ impl PopupsDemo {
|
||||
let _ = ui.button("Item");
|
||||
ui.menu_button("Recursive", |ui| self.nested_menus(ui));
|
||||
|
||||
// if ui.button(if *checked { "short" } else { "Very long text for this item that should be wrapped" }).clicked() {
|
||||
// *checked = !*checked;
|
||||
// if ui.button(if self.checked { "short" } else { "Very long text for this item that should be wrapped" }).clicked() {
|
||||
// self.checked = !self.checked;
|
||||
// }
|
||||
let checked = self.checked;
|
||||
ui.checkbox(
|
||||
checked,
|
||||
if *checked {
|
||||
&mut self.checked,
|
||||
if checked {
|
||||
"short"
|
||||
} else {
|
||||
"Very long text for this item that should be wrapped"
|
||||
|
||||
Reference in New Issue
Block a user