Skip to content

Commit

Permalink
Merge pull request #2124 from iced-rs/disable-maximize-button
Browse files Browse the repository at this point in the history
Disable maximize window button if `Settings::resizable` is `false`
  • Loading branch information
hecrj authored Oct 27, 2023
2 parents d731996 + c07315b commit 751ea77
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 @@ -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))
Expand Down

0 comments on commit 751ea77

Please sign in to comment.