diff options
author | 2022-06-21 15:59:45 -0300 | |
---|---|---|
committer | 2023-01-09 11:27:04 -0800 | |
commit | ec56c0686df1a200e37af951a3a8eca562c32a5c (patch) | |
tree | db24f45a8c3ec6288b470ea4194ad2654c1e8068 /src/multi_window | |
parent | 8fdd5ee8b60e551088d4a18fb1d58b6c3e62ba7d (diff) | |
download | iced-ec56c0686df1a200e37af951a3a8eca562c32a5c.tar.gz iced-ec56c0686df1a200e37af951a3a8eca562c32a5c.tar.bz2 iced-ec56c0686df1a200e37af951a3a8eca562c32a5c.zip |
Introduce opaque `window::Id` type
Diffstat (limited to 'src/multi_window')
-rw-r--r-- | src/multi_window/application.rs | 14 |
1 files changed, 14 insertions, 0 deletions
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::Message> { self.0.update(message) } |