From 341c9a3c12aa9d327ef1d8f168ea0adb9b5ad10b Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 19 Jun 2024 01:53:40 +0200 Subject: Introduce `daemon` API and unify shell runtimes --- src/settings.rs | 49 +++++-------------------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) (limited to 'src/settings.rs') diff --git a/src/settings.rs b/src/settings.rs index f7947841..ebac7a86 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,30 +1,17 @@ //! Configure your application. -use crate::window; use crate::{Font, Pixels}; use std::borrow::Cow; -/// The settings of an iced [`Program`]. -/// -/// [`Program`]: crate::Program +/// The settings of an iced program. #[derive(Debug, Clone)] -pub struct Settings { +pub struct Settings { /// The identifier of the application. /// /// If provided, this identifier may be used to identify the application or /// communicate with it through the windowing system. pub id: Option, - /// The window settings. - /// - /// They will be ignored on the Web. - pub window: window::Settings, - - /// The data needed to initialize the [`Program`]. - /// - /// [`Program`]: crate::Program - pub flags: Flags, - /// The fonts to load on boot. pub fonts: Vec>, @@ -50,34 +37,10 @@ pub struct Settings { pub antialiasing: bool, } -impl Settings { - /// Initialize [`Program`] settings using the given data. - /// - /// [`Program`]: crate::Program - pub fn with_flags(flags: Flags) -> Self { - let default_settings = Settings::<()>::default(); - - Self { - flags, - id: default_settings.id, - window: default_settings.window, - fonts: default_settings.fonts, - default_font: default_settings.default_font, - default_text_size: default_settings.default_text_size, - antialiasing: default_settings.antialiasing, - } - } -} - -impl Default for Settings -where - Flags: Default, -{ +impl Default for Settings { fn default() -> Self { Self { id: None, - window: window::Settings::default(), - flags: Default::default(), fonts: Vec::new(), default_font: Font::default(), default_text_size: Pixels(16.0), @@ -86,12 +49,10 @@ where } } -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 { id: settings.id, - window: settings.window, - flags: settings.flags, fonts: settings.fonts, } } -- cgit