diff --git a/src/settings.rs b/src/settings.rs index ea96961747..01ad0ee044 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -34,6 +34,22 @@ pub struct Settings { pub antialiasing: bool, } +impl Settings { + /// Initialize application settings using the given data. + /// + /// [`Application`]: ../trait.Application.html + pub fn with_flags(flags: Flags) -> Self { + Self { + flags, + // not using ..Default::default() struct update syntax since it is more permissive to + // allow initializing with flags without trait bound on Default + antialiasing: Default::default(), + default_font: Default::default(), + window: Default::default(), + } + } +} + #[cfg(not(target_arch = "wasm32"))] impl From> for iced_winit::Settings { fn from(settings: Settings) -> iced_winit::Settings {