diff options
| author | 2025-01-06 23:36:35 +0100 | |
|---|---|---|
| committer | 2025-01-06 23:36:35 +0100 | |
| commit | e722c4ee4f80833ba0b1013cadd546ebc3f490ce (patch) | |
| tree | 14fea728213e68dabed3244eaefb56bb6fb70eb5 /winit/src | |
| parent | 717b296cdb17f22b410e2985b58e73af2199bfcc (diff) | |
| parent | 5b70754809df9d9f4f3a2f7d4d348dd58bd86aa3 (diff) | |
| download | iced-e722c4ee4f80833ba0b1013cadd546ebc3f490ce.tar.gz iced-e722c4ee4f80833ba0b1013cadd546ebc3f490ce.tar.bz2 iced-e722c4ee4f80833ba0b1013cadd546ebc3f490ce.zip | |
Merge pull request #2633 from JL710/window-tasks
more window tasks
Diffstat (limited to 'winit/src')
| -rw-r--r-- | winit/src/program.rs | 41 | 
1 files changed, 38 insertions, 3 deletions
| diff --git a/winit/src/program.rs b/winit/src/program.rs index cc19a4e0..499c6252 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -1291,6 +1291,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 @@ -1354,7 +1389,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( @@ -1363,7 +1398,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));                  } @@ -1401,7 +1436,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 | 
