Avoid flicker when toggling project browser on workspace open

This commit is contained in:
Antonio Scandurra 2022-04-22 11:45:18 +02:00
parent 9730213ed7
commit 3def7a6803
3 changed files with 57 additions and 40 deletions

View file

@ -566,6 +566,18 @@ impl AsyncAppContext {
self.update(|cx| cx.add_view(window_id, build_view))
}
pub fn add_window<T, F>(
&mut self,
window_options: WindowOptions,
build_root_view: F,
) -> (usize, ViewHandle<T>)
where
T: View,
F: FnOnce(&mut ViewContext<T>) -> T,
{
self.update(|cx| cx.add_window(window_options, build_root_view))
}
pub fn platform(&self) -> Arc<dyn Platform> {
self.0.borrow().platform()
}