summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar bbb651 <bar.ye651@gmail.com>2024-10-04 21:14:06 +0300
committerLibravatar bbb651 <bar.ye651@gmail.com>2024-10-04 21:14:06 +0300
commit13c649881edfda9ab0215c7353a5236e07ef749d (patch)
treec6b70f1c4262d69d227986f2674a4cfc4f379699
parentc217500a5abd1fbfc1e598fb98dadd3ee85d8a51 (diff)
downloadiced-13c649881edfda9ab0215c7353a5236e07ef749d.tar.gz
iced-13c649881edfda9ab0215c7353a5236e07ef749d.tar.bz2
iced-13c649881edfda9ab0215c7353a5236e07ef749d.zip
Add `window::Settings::maximized`
Corresponds to `winit::window::WindowAttributes::with_maximized`
-rw-r--r--core/src/window/settings.rs4
-rw-r--r--winit/src/conversion.rs1
2 files changed, 5 insertions, 0 deletions
diff --git a/core/src/window/settings.rs b/core/src/window/settings.rs
index fbbf86ab..13822e82 100644
--- a/core/src/window/settings.rs
+++ b/core/src/window/settings.rs
@@ -34,6 +34,9 @@ pub struct Settings {
/// The initial logical dimensions of the window.
pub size: Size,
+ /// Whether the window should start maximized.
+ pub maximized: bool,
+
/// The initial position of the window.
pub position: Position,
@@ -79,6 +82,7 @@ impl Default for Settings {
fn default() -> Self {
Self {
size: Size::new(1024.0, 768.0),
+ maximized: false,
position: Position::default(),
min_size: None,
max_size: None,
diff --git a/winit/src/conversion.rs b/winit/src/conversion.rs
index 5d0f8348..e0b0569b 100644
--- a/winit/src/conversion.rs
+++ b/winit/src/conversion.rs
@@ -23,6 +23,7 @@ pub fn window_attributes(
width: settings.size.width,
height: settings.size.height,
})
+ .with_maximized(settings.maximized)
.with_resizable(settings.resizable)
.with_enabled_buttons(if settings.resizable {
winit::window::WindowButtons::all()