From c4c5216e3b69d732b0518d510f95675a4ba7010b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 30 Mar 2020 18:00:15 +0200 Subject: Allow passing external state to `Application::new` --- src/settings.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/settings.rs') diff --git a/src/settings.rs b/src/settings.rs index 32ec583c..f36ec85f 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -3,7 +3,7 @@ use crate::window; /// The settings of an application. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] -pub struct Settings { +pub struct Settings { /// The window settings. /// /// They will be ignored on the Web. @@ -11,6 +11,11 @@ pub struct Settings { /// [`Window`]: struct.Window.html pub window: window::Settings, + /// The data needed to initialize an [`Application`]. + /// + /// [`Application`]: trait.Application.html + pub flags: Flags, + /// The bytes of the font that will be used by default. /// /// If `None` is provided, a default system font will be chosen. @@ -28,8 +33,8 @@ pub struct Settings { } #[cfg(not(target_arch = "wasm32"))] -impl From for iced_winit::Settings { - fn from(settings: Settings) -> iced_winit::Settings { +impl From> for iced_winit::Settings { + fn from(settings: Settings) -> iced_winit::Settings { iced_winit::Settings { window: iced_winit::settings::Window { size: settings.window.size, @@ -37,6 +42,7 @@ impl From for iced_winit::Settings { decorations: settings.window.decorations, platform_specific: Default::default(), }, + flags: settings.flags, } } } -- cgit