Add window::Settings::maximized

Corresponds to `winit:🪟:WindowAttributes::with_maximized`
This commit is contained in:
bbb651 2024-10-04 21:14:06 +03:00
parent c217500a5a
commit 13c649881e
2 changed files with 5 additions and 0 deletions

View file

@ -34,6 +34,9 @@ pub struct Settings {
/// The initial logical dimensions of the window.
pub size: Size,
/// Whether the window should start maximized.
pub maximized: bool,
/// The initial position of the window.
pub position: Position,
@ -79,6 +82,7 @@ impl Default for Settings {
fn default() -> Self {
Self {
size: Size::new(1024.0, 768.0),
maximized: false,
position: Position::default(),
min_size: None,
max_size: None,

View file

@ -23,6 +23,7 @@ pub fn window_attributes(
width: settings.size.width,
height: settings.size.height,
})
.with_maximized(settings.maximized)
.with_resizable(settings.resizable)
.with_enabled_buttons(if settings.resizable {
winit::window::WindowButtons::all()