mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 05:10:03 -04:00
Constrain demo windows to the space left after the panels (#7785)
This commit is contained in:
@@ -105,7 +105,7 @@ impl crate::Demo for CodeExample {
|
||||
"🖮 Code Example"
|
||||
}
|
||||
|
||||
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
|
||||
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||
use crate::View as _;
|
||||
egui::Window::new(self.name())
|
||||
.open(open)
|
||||
@@ -113,7 +113,8 @@ impl crate::Demo for CodeExample {
|
||||
.default_size([390.0, 500.0])
|
||||
.scroll(false)
|
||||
.resizable([true, false]) // resizable so we can shrink if the text edit grows
|
||||
.show(ctx, |ui| self.ui(ui));
|
||||
.constrain_to(ui.available_rect_before_wrap())
|
||||
.show(ui, |ui| self.ui(ui));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user