fix(multi-window): update example
This commit is contained in:
parent
5072cc3045
commit
78cf62a517
1 changed files with 2 additions and 5 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue