Emit Event::PaneAdded in Workspace when a new pane is created

This commit is contained in:
Antonio Scandurra 2022-03-29 10:24:42 +02:00
parent d7026c2228
commit d296bb21a8

View File

@ -650,6 +650,10 @@ impl WorkspaceParams {
}
}
pub enum Event {
PaneAdded(ViewHandle<Pane>),
}
pub struct Workspace {
weak_self: WeakViewHandle<Self>,
client: Arc<Client>,
@ -1061,6 +1065,7 @@ impl Workspace {
.detach();
self.panes.push(pane.clone());
self.activate_pane(pane.clone(), cx);
cx.emit(Event::PaneAdded(pane.clone()));
pane
}
@ -1916,7 +1921,7 @@ impl Workspace {
}
impl Entity for Workspace {
type Event = ();
type Event = Event;
}
impl View for Workspace {