demo: demonstrate how to prevent auto-shrinking windows
This commit is contained in:
parent
906a798003
commit
52193c2273
1 changed files with 11 additions and 0 deletions
|
@ -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…
Reference in a new issue