diff --git a/iced_layershell/src/build_pattern.rs b/iced_layershell/src/build_pattern.rs index 98aeb7a..b879258 100644 --- a/iced_layershell/src/build_pattern.rs +++ b/iced_layershell/src/build_pattern.rs @@ -6,7 +6,7 @@ use iced::{Font, Pixels}; use crate::settings::{LayerShellSettings, VirtualKeyboardSettings}; -/// The renderer of some [`Program`]. +/// The renderer of some Program. pub trait Renderer: iced_core::text::Renderer + iced_graphics::compositor::Default {} impl Renderer for T where T: iced_core::text::Renderer + iced_graphics::compositor::Default {} @@ -21,7 +21,7 @@ pub struct MainSettings { /// settings for layer shell pub layer_settings: LayerShellSettings, - /// The data needed to initialize an [`Application`]. + /// The data needed to initialize an Application /// /// The fonts to load on boot. pub fonts: Vec>, diff --git a/iced_sessionlock/src/build_pattern.rs b/iced_sessionlock/src/build_pattern.rs index cc1c835..2411f7a 100644 --- a/iced_sessionlock/src/build_pattern.rs +++ b/iced_sessionlock/src/build_pattern.rs @@ -2,7 +2,7 @@ use std::borrow::Cow; use iced::{Font, Pixels}; -/// The renderer of some [`Program`]. +/// The renderer of iced program. pub trait Renderer: iced_core::text::Renderer + iced_graphics::compositor::Default {} impl Renderer for T where T: iced_core::text::Renderer + iced_graphics::compositor::Default {} @@ -15,7 +15,7 @@ pub struct MainSettings { /// communicate with it through the windowing system. pub id: Option, - /// The data needed to initialize an [`Application`]. + /// The data needed to initialize an Application. /// /// The fonts to load on boot. pub fonts: Vec>, @@ -87,7 +87,7 @@ mod pattern { type Theme: Default + DefaultStyle; /// Initializes the [`Application`] with the flags provided to - /// [`run`] as part of the [`Settings`]. + /// run as part of the [`Settings`]. /// /// Here is where you should return the initial state of your app. /// @@ -133,14 +133,14 @@ mod pattern { theme.default_style() } - /// Returns the event [`Subscription`] for the current state of the + /// Returns the event [`iced::Subscription`] for the current state of the /// application. /// - /// A [`Subscription`] will be kept alive as long as you keep returning it, + /// A [`iced::Subscription`] will be kept alive as long as you keep returning it, /// and the __messages__ produced will be handled by - /// [`update`](#tymethod.update). + /// [`Program::update`](#tymethod.update). /// - /// By default, this method returns an empty [`Subscription`]. + /// By default, this method returns an empty [`iced::Subscription`]. fn subscription(&self, _state: &Self::State) -> iced::Subscription { iced::Subscription::none() } @@ -315,7 +315,7 @@ mod pattern { } } #[derive(Debug)] - pub struct SingleApplication { + pub struct Application { raw: A, settings: MainSettings, } @@ -323,7 +323,7 @@ mod pattern { pub fn application( update: impl Update, view: impl for<'a> self::View<'a, State, Message, Theme, Renderer>, - ) -> SingleApplication> + ) -> Application> where State: 'static, Message: 'static + TryInto + Send + std::fmt::Debug, @@ -370,7 +370,7 @@ mod pattern { self.view.view(state, window).into() } } - SingleApplication { + Application { raw: Instance { update, view, @@ -688,7 +688,7 @@ mod pattern { } } - impl SingleApplication

{ + impl Application

{ pub fn run(self) -> Result where Self: 'static, @@ -740,9 +740,9 @@ mod pattern { pub fn style( self, f: impl Fn(&P::State, &P::Theme) -> crate::Appearance, - ) -> SingleApplication> + ) -> Application> { - SingleApplication { + Application { raw: with_style(self.raw, f), settings: self.settings, } @@ -751,9 +751,9 @@ mod pattern { pub fn subscription( self, f: impl Fn(&P::State) -> iced::Subscription, - ) -> SingleApplication> + ) -> Application> { - SingleApplication { + Application { raw: with_subscription(self.raw, f), settings: self.settings, } @@ -763,9 +763,9 @@ mod pattern { pub fn theme( self, f: impl Fn(&P::State) -> P::Theme, - ) -> SingleApplication> + ) -> Application> { - SingleApplication { + Application { raw: with_theme(self.raw, f), settings: self.settings, } @@ -775,9 +775,9 @@ mod pattern { pub fn scale_factor( self, f: impl Fn(&P::State, iced_core::window::Id) -> f64, - ) -> SingleApplication> + ) -> Application> { - SingleApplication { + Application { raw: with_scale_factor(self.raw, f), settings: self.settings, } @@ -785,11 +785,11 @@ mod pattern { /// Sets the executor of the [`Application`]. pub fn executor( self, - ) -> SingleApplication> + ) -> Application> where E: iced_futures::Executor, { - SingleApplication { + Application { raw: with_executor::(self.raw), settings: self.settings, }