Merge pull request #2124 from iced-rs/disable-maximize-button

Disable maximize window button if `Settings::resizable` is `false`
This commit is contained in:
Héctor Ramón 2023-10-27 17:38:14 +02:00 committed by GitHub
commit 751ea77c29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,6 +134,12 @@ impl Window {
.with_title(title)
.with_inner_size(winit::dpi::LogicalSize { width, height })
.with_resizable(self.resizable)
.with_enabled_buttons(if self.resizable {
winit::window::WindowButtons::all()
} else {
winit::window::WindowButtons::CLOSE
| winit::window::WindowButtons::MINIMIZE
})
.with_decorations(self.decorations)
.with_transparent(self.transparent)
.with_window_icon(self.icon.and_then(conversion::icon))