mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
Add Floating and Frame containers as building blocks for windows
This commit is contained in:
@@ -3,13 +3,7 @@
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use {
|
||||
emigui::{
|
||||
example_app::ExampleApp,
|
||||
label,
|
||||
math::*,
|
||||
widgets::{Button, Label},
|
||||
Align, CursorIcon, Emigui, Window,
|
||||
},
|
||||
emigui::{example_app::ExampleApp, widgets::*, *},
|
||||
emigui_glium::Painter,
|
||||
glium::glutin,
|
||||
};
|
||||
@@ -127,6 +121,19 @@ fn main() {
|
||||
emigui.ui(region);
|
||||
});
|
||||
|
||||
Floating::new().show(region.ctx(), "Floating", |region| {
|
||||
Frame::default().show(region, |region| {
|
||||
Resize::default()
|
||||
.default_size(vec2(300.0, 200.0))
|
||||
.auto_expand(true)
|
||||
.show(region, |region| {
|
||||
region.add(Label::new("Fake Window").text_style(TextStyle::Heading));
|
||||
region.add(Separator::new().line_width(1.0)); // TODO: nicer way to split window title from contents
|
||||
region.add(label!("Floating Frame Resize"));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
let (output, paint_batches) = emigui.end_frame();
|
||||
painter.paint_batches(&display, paint_batches, emigui.texture());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user