1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

added epi::Frame::set_window_pos (#1505)

this allows setting the position of window at runtime
This commit is contained in:
Boby
2022-04-17 01:57:22 +05:30
committed by GitHub
parent 2b861f86e8
commit 96335d5f45
3 changed files with 17 additions and 0 deletions

View File

@@ -96,6 +96,7 @@ pub fn handle_app_output(
window_title,
decorated,
drag_window,
window_pos,
} = app_output;
if let Some(decorated) = decorated {
@@ -116,6 +117,13 @@ pub fn handle_app_output(
window.set_title(&window_title);
}
if let Some(window_pos) = window_pos {
window.set_outer_position(winit::dpi::PhysicalPosition {
x: window_pos.x as f64,
y: window_pos.y as f64,
});
}
if drag_window {
let _ = window.drag_window();
}