Move methods querying window state into AsyncAppContext

This commit is contained in:
Antonio Scandurra 2023-05-02 19:28:58 +02:00
parent 4f6939732e
commit 70f8cf4cf6
9 changed files with 116 additions and 113 deletions

View file

@ -182,7 +182,11 @@ impl TestAppContext {
}
pub fn window_ids(&self) -> Vec<usize> {
self.cx.borrow().window_ids().collect()
self.cx.borrow().windows.keys().copied().collect()
}
pub fn remove_all_windows(&mut self) {
self.update(|cx| cx.windows.clear());
}
pub fn read<T, F: FnOnce(&AppContext) -> T>(&self, callback: F) -> T {