Browse Source

demo: demonstrate how to prevent auto-shrinking windows

pull/669/head
Emil Ernerfeldt 3 years ago
parent
commit
52193c2273
  1. 11
      egui_demo_lib/src/apps/demo/tests.rs

11
egui_demo_lib/src/apps/demo/tests.rs

@ -442,9 +442,20 @@ impl super::Demo for WindowResizeTest {
.open(open)
.scroll(false)
.resizable(true)
.default_height(300.0)
.show(ctx, |ui| {
ui.label("Shows how you can fill an area with a widget.");
ui.add_sized(ui.available_size(), TextEdit::multiline(&mut self.text));
});
Window::new("↔ freely resized")
.open(open)
.scroll(false)
.resizable(true)
.default_size([250.0, 150.0])
.show(ctx, |ui| {
ui.label("This window has empty space that fills up the available space, preventing auto-shrink.");
ui.allocate_space(ui.available_size());
});
}
}

Loading…
Cancel
Save