Modify src/settings.rs to keep original API

This commit is contained in:
hatoo 2019-12-02 21:57:07 +09:00
parent a1f9be3089
commit 97f1f3dcf4

View file

@ -19,12 +19,6 @@ 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.
pub decorations: bool,
/// Platform specific Setting.
pub platform_specific: iced_winit::settings::PlatformSpecific,
} }
impl Default for Window { impl Default for Window {
@ -32,8 +26,6 @@ impl Default for Window {
Window { Window {
size: (1024, 768), size: (1024, 768),
resizable: true, resizable: true,
decorations: true,
platform_specific: Default::default(),
} }
} }
} }
@ -41,13 +33,9 @@ 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 {
iced_winit::Settings { let mut iced_winit_settings = iced_winit::settings::Settings::default();
window: iced_winit::settings::Window { iced_winit_settings.window.size = settings.window.size;
size: settings.window.size, iced_winit_settings.window.resizable = settings.window.resizable;
resizable: settings.window.resizable, iced_winit_settings
decorations: settings.window.decorations,
platform_specific: settings.window.platform_specific,
},
}
} }
} }