From c07315b84eb59daeb9bbe7480f30dc0937ceca13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Fri, 27 Oct 2023 05:53:29 +0200 Subject: [PATCH] Disable maximize window button if `Settings::resizable` is `false` --- winit/src/settings.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 867dad0f2c..16c9fcdc2e 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -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))