fix(multi-window): update example

This commit is contained in:
Ashley Wulber 2025-03-05 15:50:40 -05:00
parent 5072cc3045
commit 78cf62a517
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -74,10 +74,7 @@ impl cosmic::Application for MultiWindow {
}) })
} }
fn update( fn update(&mut self, message: Self::Message) -> iced::Task<cosmic::Action<Self::Message>> {
&mut self,
message: Self::Message,
) -> iced::Task<cosmic::app::Message<Self::Message>> {
match message { match message {
Message::CloseWindow(id) => window::close(id), Message::CloseWindow(id) => window::close(id),
Message::WindowClosed(id) => { Message::WindowClosed(id) => {
@ -110,7 +107,7 @@ impl cosmic::Application for MultiWindow {
); );
_ = self.set_window_title(format!("window_{}", count), id); _ = self.set_window_title(format!("window_{}", count), id);
spawn_window.map(|id| cosmic::app::Message::App(Message::WindowOpened(id, None))) spawn_window.map(|id| cosmic::Action::App(Message::WindowOpened(id, None)))
} }
Message::Input(id, value) => { Message::Input(id, value) => {
if let Some((_, w)) = self.windows.iter_mut().find(|e| e.1.input_id == id) { if let Some((_, w)) = self.windows.iter_mut().find(|e| e.1.input_id == id) {