From ab45cdecdcf60a986c46e0860e29e09438fb172a Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 8 Feb 2020 08:43:32 +0300 Subject: [PATCH] anvil.window_map: add refresh_toplevel --- anvil/src/window_map.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/anvil/src/window_map.rs b/anvil/src/window_map.rs index 9a8fd9f..c014626 100644 --- a/anvil/src/window_map.rs +++ b/anvil/src/window_map.rs @@ -237,6 +237,13 @@ where } } + /// Refreshes the state of the toplevel, if it exists. + pub fn refresh_toplevel(&mut self, toplevel: &Kind) { + 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(); }