summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-10-27 05:53:29 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-10-27 06:01:04 +0200
commitc07315b84eb59daeb9bbe7480f30dc0937ceca13 (patch)
treebee25f55c65ec2486f0f06f922f30c32e98ddbc1
parent3ec5ad42251d4f35861f3bed621223e383742b12 (diff)
downloadiced-c07315b84eb59daeb9bbe7480f30dc0937ceca13.tar.gz
iced-c07315b84eb59daeb9bbe7480f30dc0937ceca13.tar.bz2
iced-c07315b84eb59daeb9bbe7480f30dc0937ceca13.zip
Disable maximize window button if `Settings::resizable` is `false`
-rw-r--r--winit/src/settings.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/winit/src/settings.rs b/winit/src/settings.rs
index 867dad0f..16c9fcdc 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))