Skip to content

Commit

Permalink
Disable maximize window button if Settings::resizable is false
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Oct 27, 2023
1 parent 3ec5ad4 commit c07315b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions winit/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c07315b

Please sign in to comment.