Not working yet file-finder2
This commit is contained in:
@@ -71,6 +71,14 @@ impl ModalLayer {
|
||||
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
pub fn current_modal<V>(&self) -> Option<View<V>>
|
||||
where
|
||||
V: 'static,
|
||||
{
|
||||
let active_modal = self.active_modal.as_ref()?;
|
||||
active_modal.modal.clone().downcast::<V>().ok()
|
||||
}
|
||||
}
|
||||
|
||||
impl Render for ModalLayer {
|
||||
|
||||
@@ -3541,6 +3541,10 @@ impl Workspace {
|
||||
div
|
||||
}
|
||||
|
||||
pub fn current_modal<V: Modal + 'static>(&mut self, cx: &ViewContext<Self>) -> Option<View<V>> {
|
||||
self.modal_layer.read(cx).current_modal()
|
||||
}
|
||||
|
||||
pub fn toggle_modal<V: Modal, B>(&mut self, cx: &mut ViewContext<Self>, build: B)
|
||||
where
|
||||
B: FnOnce(&mut ViewContext<V>) -> V,
|
||||
|
||||
Reference in New Issue
Block a user