Finished erorr terminal refactoring

This commit is contained in:
Mikayla Maki 2022-07-21 12:37:15 -07:00
parent 7c0a031506
commit c6d5decbf9
8 changed files with 311 additions and 295 deletions

View file

@ -1223,8 +1223,10 @@ impl Workspace {
}
}
pub fn modal(&self) -> Option<&AnyViewHandle> {
self.modal.as_ref()
pub fn modal<V: 'static + View>(&self) -> Option<ViewHandle<V>> {
self.modal
.as_ref()
.and_then(|modal| modal.clone().downcast::<V>())
}
pub fn dismiss_modal(&mut self, cx: &mut ViewContext<Self>) {