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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user