window tasks for setting min and max size

This commit is contained in:
JL710 2024-10-11 12:10:30 +02:00 committed by Héctor Ramón Jiménez
parent ca8aaf9b8d
commit 8ebbfa9767
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 36 additions and 0 deletions

View file

@ -1291,6 +1291,26 @@ 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(|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);