1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Constrain demo windows to the space left after the panels (#7785)

This commit is contained in:
Emil Ernerfeldt
2025-12-17 21:03:52 +01:00
committed by GitHub
parent 51493be066
commit ca1e76f38b
84 changed files with 272 additions and 215 deletions

View File

@@ -28,11 +28,14 @@ impl crate::Demo for FontBook {
"🔤 Font Book"
}
fn show(&mut self, ctx: &egui::Context, open: &mut bool) {
egui::Window::new(self.name()).open(open).show(ctx, |ui| {
use crate::View as _;
self.ui(ui);
});
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
egui::Window::new(self.name())
.open(open)
.constrain_to(ui.available_rect_before_wrap())
.show(ui, |ui| {
use crate::View as _;
self.ui(ui);
});
}
}