From ec56c0686df1a200e37af951a3a8eca562c32a5c Mon Sep 17 00:00:00 2001 From: Richard Date: Tue, 21 Jun 2022 15:59:45 -0300 Subject: Introduce opaque `window::Id` type --- src/multi_window/application.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/multi_window') diff --git a/src/multi_window/application.rs b/src/multi_window/application.rs index fa0c15b1..6b3f4676 100644 --- a/src/multi_window/application.rs +++ b/src/multi_window/application.rs @@ -1,3 +1,4 @@ +use crate::window; use crate::{Command, Element, Executor, Settings, Subscription}; pub use iced_native::application::{Appearance, StyleSheet}; @@ -45,6 +46,9 @@ pub trait Application: Sized { /// title of your application when necessary. fn title(&self) -> String; + /// TODO(derezzedex) + fn windows(&self) -> Vec<(window::Id, window::Settings)>; + /// Handles a __message__ and updates the state of the [`Application`]. /// /// This is where you define your __update logic__. All the __messages__, @@ -160,6 +164,16 @@ where self.0.title() } + fn windows(&self) -> Vec<(window::Id, iced_winit::settings::Window)> { + self.0 + .windows() + .into_iter() + .map(|(id, settings)| { + (id, iced_winit::settings::Window::from(settings)) + }) + .collect() + } + fn update(&mut self, message: Self::Message) -> Command { self.0.update(message) } -- cgit