mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 15:20:05 -04:00
Constrain demo windows to the space left after the panels (#7785)
This commit is contained in:
@@ -3,8 +3,8 @@ use std::sync::Arc;
|
||||
use super::{Demo, View};
|
||||
|
||||
use egui::{
|
||||
Align, Align2, Checkbox, CollapsingHeader, Color32, ComboBox, Context, FontId, Resize,
|
||||
RichText, Sense, Slider, Stroke, TextFormat, TextStyle, Ui, Vec2, Window, vec2,
|
||||
Align, Align2, Checkbox, CollapsingHeader, Color32, ComboBox, FontId, Resize, RichText, Sense,
|
||||
Slider, Stroke, TextFormat, TextStyle, Ui, Vec2, Window, vec2,
|
||||
};
|
||||
|
||||
/// Showcase some ui code
|
||||
@@ -49,12 +49,13 @@ impl Demo for MiscDemoWindow {
|
||||
"✨ Misc Demos"
|
||||
}
|
||||
|
||||
fn show(&mut self, ctx: &Context, open: &mut bool) {
|
||||
fn show(&mut self, ui: &mut egui::Ui, open: &mut bool) {
|
||||
Window::new(self.name())
|
||||
.open(open)
|
||||
.vscroll(true)
|
||||
.hscroll(true)
|
||||
.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