mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Serialize window maximized state in WindowSettings (#5554)
A user of my Windows application reported a papercut where the application restores its size on next load, but does not restore its maximized state. This PR fixes that. To test, I patched https://github.com/emilk/eframe_template to use my local code since I knew that template saves/restores window data. Testing methodology was to simply `cargo run`, maximize the application, then close the application. `cargo run` again and the application should start maximized. Closes #1517. * [x] I have followed the instructions in the PR template * * This is mostly true, I had difficulties running `./scripts/check.sh` for some reason. Possibly a bad Python version?
This commit is contained in:
@@ -1824,6 +1824,9 @@ pub fn apply_viewport_builder_to_window(
|
||||
let pos = PhysicalPosition::new(pixels_per_point * pos.x, pixels_per_point * pos.y);
|
||||
window.set_outer_position(pos);
|
||||
}
|
||||
if let Some(maximized) = builder.maximized {
|
||||
window.set_maximized(maximized);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user