Disable maximize window button if Settings::resizable is false

This commit is contained in:
Héctor Ramón Jiménez 2023-10-27 05:53:29 +02:00
parent 3ec5ad4225
commit c07315b84e
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -130,6 +130,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))