diff options
Diffstat (limited to 'src/multi_window')
-rw-r--r-- | src/multi_window/application.rs | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/multi_window/application.rs b/src/multi_window/application.rs index db41d54a..fa0c15b1 100644 --- a/src/multi_window/application.rs +++ b/src/multi_window/application.rs @@ -132,7 +132,7 @@ pub trait Application: Sized { ..crate::renderer::Settings::from_env() }; - Ok(crate::runtime::application::run::< + Ok(crate::runtime::multi_window::run::< Instance<Self>, Self::Executor, crate::renderer::window::Compositor<Self::Theme>, @@ -142,28 +142,14 @@ pub trait Application: Sized { struct Instance<A: Application>(A); -impl<A> iced_winit::Program for Instance<A> +impl<A> crate::runtime::multi_window::Application for Instance<A> where A: Application, { + type Flags = A::Flags; type Renderer = crate::Renderer<A::Theme>; type Message = A::Message; - fn update(&mut self, message: Self::Message) -> Command<Self::Message> { - self.0.update(message) - } - - fn view(&self) -> Element<'_, Self::Message, Self::Renderer> { - self.0.view() - } -} - -impl<A> crate::runtime::Application for Instance<A> -where - A: Application, -{ - type Flags = A::Flags; - fn new(flags: Self::Flags) -> (Self, Command<A::Message>) { let (app, command) = A::new(flags); @@ -174,6 +160,14 @@ where self.0.title() } + fn update(&mut self, message: Self::Message) -> Command<Self::Message> { + self.0.update(message) + } + + fn view(&self) -> Element<'_, Self::Message, Self::Renderer> { + self.0.view() + } + fn theme(&self) -> A::Theme { self.0.theme() } |