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