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 {
|
pub struct Workspace {
|
||||||
weak_self: WeakViewHandle<Self>,
|
weak_self: WeakViewHandle<Self>,
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
|
@ -1061,6 +1065,7 @@ impl Workspace {
|
||||||
.detach();
|
.detach();
|
||||||
self.panes.push(pane.clone());
|
self.panes.push(pane.clone());
|
||||||
self.activate_pane(pane.clone(), cx);
|
self.activate_pane(pane.clone(), cx);
|
||||||
|
cx.emit(Event::PaneAdded(pane.clone()));
|
||||||
pane
|
pane
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1916,7 +1921,7 @@ impl Workspace {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Entity for Workspace {
|
impl Entity for Workspace {
|
||||||
type Event = ();
|
type Event = Event;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl View for Workspace {
|
impl View for Workspace {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue