1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Add button to collapse windows

This commit is contained in:
Emil Ernerfeldt
2020-05-17 12:26:17 +02:00
parent c79b28e3b0
commit f9bb9f71c4
8 changed files with 276 additions and 152 deletions

View File

@@ -62,8 +62,10 @@ fn main() {
let pixels_per_point = display.gl_window().get_hidpi_factor() as f32;
let mut ctx = Context::new(pixels_per_point);
let mut painter = emigui_glium::Painter::new(&display);
let mut ctx = profile("initializing emilib", || Context::new(pixels_per_point));
let mut painter = profile("initializing painter", || {
emigui_glium::Painter::new(&display)
});
let mut raw_input = emigui::RawInput {
screen_size: {
@@ -143,6 +145,7 @@ fn main() {
emigui_glium::handle_output(output, &display, clipboard.as_mut());
}
// Save state to disk:
window_settings.pos = display
.gl_window()
.get_position()
@@ -162,3 +165,11 @@ fn main() {
)
.unwrap();
}
fn profile<R>(name: &str, action: impl FnOnce() -> R) -> R {
let start = Instant::now();
let r = action();
let elapsed = start.elapsed();
eprintln!("{}: {} ms", name, elapsed.as_millis());
r
}