提交 f1ad6834 编写于 作者: I isidor

panelViewlet: only update title area if no longer a singleView or becoming a singleView

fixes #45033
上级 b877522b
......@@ -266,10 +266,14 @@ export class PanelViewlet extends Viewlet {
const disposable = combinedDisposable([onDidFocus, styler, onDidChange]);
const panelItem: IViewletPanelItem = { panel, disposable };
const wasSingleView = this.isSingleView();
this.panelItems.splice(index, 0, panelItem);
this.panelview.addPanel(panel, size, index);
this.updateViewHeaders();
if (this.isSingleView() !== wasSingleView) {
this.updateTitleArea();
}
}
removePanel(panel: ViewletPanel): void {
......@@ -283,11 +287,15 @@ export class PanelViewlet extends Viewlet {
this.lastFocusedPanel = undefined;
}
const wasSingleView = this.isSingleView();
this.panelview.removePanel(panel);
const [panelItem] = this.panelItems.splice(index, 1);
panelItem.disposable.dispose();
this.updateViewHeaders();
if (wasSingleView !== this.isSingleView()) {
this.updateTitleArea();
}
}
movePanel(from: ViewletPanel, to: ViewletPanel): void {
......
......@@ -35,8 +35,6 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { Disposable } from 'vs/base/common/lifecycle';
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
import { IPartService } from 'vs/workbench/services/part/common/partService';
import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet';
export class ExplorerViewletViewsContribution extends Disposable implements IWorkbenchContribution {
......@@ -241,16 +239,6 @@ export class ExplorerViewlet extends PersistentViewsViewlet implements IExplorer
return <EmptyView>this.getView(EmptyView.ID);
}
public addPanel(panel: ViewletPanel, size: number, index: number): void {
super.addPanel(panel, size, index);
this.updateTitleArea();
}
public removePanel(panel: ViewletPanel): void {
super.removePanel(panel);
this.updateTitleArea();
}
public setVisible(visible: boolean): TPromise<void> {
this.viewletVisibleContextKey.set(visible);
return super.setVisible(visible);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册