Merge branch 'main' into ime-support-2

This commit is contained in:
Antonio Scandurra 2022-07-25 10:47:49 +02:00
commit ca3e73106c
32 changed files with 2520 additions and 1790 deletions

View file

@ -1224,8 +1224,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>) {