summaryrefslogtreecommitdiffstats
path: root/src/settings.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-03 07:08:12 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-03 07:08:12 +0100
commit369ed9bc2e3c09666458bd0a0c0834a402239b3f (patch)
tree57ef803632571c89ad3664bef6bc6f24d19b0cae /src/settings.rs
parent287f3ea99a41f5452ea0ea2fcd075742d6ca4285 (diff)
downloadiced-369ed9bc2e3c09666458bd0a0c0834a402239b3f.tar.gz
iced-369ed9bc2e3c09666458bd0a0c0834a402239b3f.tar.bz2
iced-369ed9bc2e3c09666458bd0a0c0834a402239b3f.zip
Add `decorations` to `settings::Window`
Diffstat (limited to 'src/settings.rs')
-rw-r--r--src/settings.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/settings.rs b/src/settings.rs
index bd13dcaa..62a1a614 100644
--- a/src/settings.rs
+++ b/src/settings.rs
@@ -19,6 +19,9 @@ pub struct Window {
/// Whether the window should be resizable or not.
pub resizable: bool,
+
+ /// Whether the window should have a border, a title bar, etc. or not.
+ pub decorations: bool,
}
impl Default for Window {
@@ -26,6 +29,7 @@ impl Default for Window {
Window {
size: (1024, 768),
resizable: true,
+ decorations: true,
}
}
}
@@ -33,9 +37,13 @@ impl Default for Window {
#[cfg(not(target_arch = "wasm32"))]
impl From<Settings> for iced_winit::Settings {
fn from(settings: Settings) -> iced_winit::Settings {
- let mut iced_winit_settings = iced_winit::settings::Settings::default();
- iced_winit_settings.window.size = settings.window.size;
- iced_winit_settings.window.resizable = settings.window.resizable;
- iced_winit_settings
+ iced_winit::Settings {
+ window: iced_winit::settings::Window {
+ size: settings.window.size,
+ resizable: settings.window.resizable,
+ decorations: settings.window.decorations,
+ platform_specific: Default::default(),
+ },
+ }
}
}