Maintain an active pane container on the workspace

This will be used by many commands that previously only interacted with
the center of the workspace.
This commit is contained in:
Nathan Sobo
2017-04-06 15:30:01 -06:00
committed by Max Brunsfeld
parent f1e30fe7cf
commit 646047f563
5 changed files with 207 additions and 22 deletions

View File

@@ -33,6 +33,7 @@ module.exports = class Dock {
this.deserializerManager = params.deserializerManager
this.notificationManager = params.notificationManager
this.viewRegistry = params.viewRegistry
this.didActivate = params.didActivate
this.didHide = params.didHide
this.paneContainer = new PaneContainer({
@@ -50,10 +51,13 @@ module.exports = class Dock {
}
this.subscriptions = new CompositeDisposable(
this.paneContainer.onDidActivatePane(() => this.open()),
this.paneContainer.observePanes(pane => {
pane.onDidRemoveItem(this.handleDidRemovePaneItem.bind(this))
})
this.paneContainer.onDidActivatePane(() => {
this.open()
this.didActivate(this)
}),
this.paneContainer.onDidDestroyPaneItem(this.handleDidRemovePaneItem.bind(this)),
this.paneContainer.onDidChangeActivePane((item) => params.didChangeActivePane(this, item)),
this.paneContainer.onDidChangeActivePaneItem((item) => params.didChangeActivePaneItem(this, item))
)
}
@@ -94,7 +98,6 @@ module.exports = class Dock {
}
activate () {
this.open()
this.getActivePane().activate()
}