From 8ebbfa9767bcb8f8efd43cc1c7d40e9c61f6c461 Mon Sep 17 00:00:00 2001 From: JL710 <76447362+JL710@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:10:30 +0200 Subject: window tasks for setting min and max size --- winit/src/program.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'winit') diff --git a/winit/src/program.rs b/winit/src/program.rs index 052b36b0..58fec9df 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -1291,6 +1291,26 @@ fn run_action
( ); } } + window::Action::SetMinSize(id, size) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_min_inner_size(size.map(|x| { + winit::dpi::LogicalSize { + width: x.width, + height: x.height, + } + })); + } + } + window::Action::SetMaxSize(id, size) => { + if let Some(window) = window_manager.get_mut(id) { + window.raw.set_max_inner_size(size.map(|x| { + winit::dpi::LogicalSize { + width: x.width, + height: x.height, + } + })); + } + } window::Action::ChangeTitle(id, title) => { if let Some(window) = window_manager.get_mut(id) { window.raw.set_title(&title); -- cgit