anvil.window_map: add refresh_toplevel

This commit is contained in:
Ivan Molodetskikh 2020-02-08 08:43:32 +03:00
parent 9eb51b8439
commit ab45cdecdc
No known key found for this signature in database
GPG Key ID: 02CE38DA47E9D691
1 changed files with 7 additions and 0 deletions

View File

@ -237,6 +237,13 @@ where
}
}
/// Refreshes the state of the toplevel, if it exists.
pub fn refresh_toplevel(&mut self, toplevel: &Kind<R>) {
if let Some(w) = self.windows.iter_mut().find(|w| w.toplevel.equals(toplevel)) {
w.self_update(self.ctoken);
}
}
pub fn clear(&mut self) {
self.windows.clear();
}