Emit Event::PaneAdded
in Workspace
when a new pane is created
This commit is contained in:
parent
d7026c2228
commit
d296bb21a8
1 changed files with 6 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue