diff options
Diffstat (limited to 'winit')
-rw-r--r-- | winit/src/conversion.rs | 6 | ||||
-rw-r--r-- | winit/src/program.rs | 41 |
2 files changed, 44 insertions, 3 deletions
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs index 8e6f7aae..01c6abc8 100644 --- a/winit/src/conversion.rs +++ b/winit/src/conversion.rs @@ -23,6 +23,12 @@ pub fn window_attributes( width: settings.size.width, height: settings.size.height, }) + .with_maximized(settings.maximized) + .with_fullscreen( + settings + .fullscreen + .then_some(winit::window::Fullscreen::Borderless(None)), + ) .with_resizable(settings.resizable) .with_enabled_buttons(if settings.resizable { winit::window::WindowButtons::all() diff --git a/winit/src/program.rs b/winit/src/program.rs index 0f1ea042..dddaf33d 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -1275,6 +1275,41 @@ fn run_action<P, C>( ); } } + window::Action::SetMinSize(id, size) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_min_inner_size(size.map(|size| { + winit::dpi::LogicalSize { + width: size.width, + height: size.height, + } + })); + } + } + window::Action::SetMaxSize(id, size) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_max_inner_size(size.map(|size| { + winit::dpi::LogicalSize { + width: size.width, + height: size.height, + } + })); + } + } + window::Action::SetResizeIncrements(id, increments) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_resize_increments(increments.map(|size| { + winit::dpi::LogicalSize { + width: size.width, + height: size.height, + } + })); + } + } + window::Action::SetResizable(id, resizable) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_resizable(resizable); + } + } window::Action::GetSize(id, channel) => { if let Some(window) = window_manager.get_mut(id) { let size = window @@ -1338,7 +1373,7 @@ fn run_action<P, C>( ); } } - window::Action::ChangeMode(id, mode) => { + window::Action::SetMode(id, mode) => { if let Some(window) = window_manager.get_mut(id) { window.raw.set_visible(conversion::visible(mode)); window.raw.set_fullscreen(conversion::fullscreen( @@ -1347,7 +1382,7 @@ fn run_action<P, C>( )); } } - window::Action::ChangeIcon(id, icon) => { + window::Action::SetIcon(id, icon) => { if let Some(window) = window_manager.get_mut(id) { window.raw.set_window_icon(conversion::icon(icon)); } @@ -1385,7 +1420,7 @@ fn run_action<P, C>( window.raw.focus_window(); } } - window::Action::ChangeLevel(id, level) => { + window::Action::SetLevel(id, level) => { if let Some(window) = window_manager.get_mut(id) { window .raw |