Add decorations to settings::Window

This commit is contained in:
Héctor Ramón Jiménez 2019-12-03 07:08:12 +01:00
parent 287f3ea99a
commit 369ed9bc2e

View file

@ -19,6 +19,9 @@ pub struct Window {
/// Whether the window should be resizable or not. /// Whether the window should be resizable or not.
pub resizable: bool, pub resizable: bool,
/// Whether the window should have a border, a title bar, etc. or not.
pub decorations: bool,
} }
impl Default for Window { impl Default for Window {
@ -26,6 +29,7 @@ impl Default for Window {
Window { Window {
size: (1024, 768), size: (1024, 768),
resizable: true, resizable: true,
decorations: true,
} }
} }
} }
@ -33,9 +37,13 @@ impl Default for Window {
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
impl From<Settings> for iced_winit::Settings { impl From<Settings> for iced_winit::Settings {
fn from(settings: Settings) -> iced_winit::Settings { fn from(settings: Settings) -> iced_winit::Settings {
let mut iced_winit_settings = iced_winit::settings::Settings::default(); iced_winit::Settings {
iced_winit_settings.window.size = settings.window.size; window: iced_winit::settings::Window {
iced_winit_settings.window.resizable = settings.window.resizable; size: settings.window.size,
iced_winit_settings resizable: settings.window.resizable,
decorations: settings.window.decorations,
platform_specific: Default::default(),
},
}
} }
} }