diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index 243f194cb4ed522d016ee1e386ea05fa7a0bf300..7b8d1f7fe4150fc909aac488dfe977addccc48c9 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -46,6 +46,11 @@ interface ComputedStyles { statusbar: { height: number; }; } +export interface ILayoutOptions { + forceStyleReCompute?: boolean; + toggleMaximizedPanel?: boolean; +} + /** * The workbench layout is responsible to lay out all parts that make the Workbench. */ @@ -297,8 +302,8 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal }; } - public layout(forceStyleReCompute?: boolean, toggleMaximizedPanel?: boolean): void { - if (forceStyleReCompute) { + public layout(options?: ILayoutOptions): void { + if (options && options.forceStyleReCompute) { this.computeStyle(); this.editor.getLayout().computeStyle(); this.sidebar.getLayout().computeStyle(); @@ -346,7 +351,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal } else { panelHeight = sidebarSize.height * 0.4; } - if (toggleMaximizedPanel) { + if (options && options.toggleMaximizedPanel) { panelHeight = panelHeight === maxPanelHeight ? sidebarSize.height * 0.4 : maxPanelHeight; } const panelDimension = new Dimension(this.workbenchSize.width - sidebarSize.width - activityBarSize.width, panelHeight); diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 02df8725d0e340c27780f502fd103358c0754cb9..9c314525c0b49aa21c7b943105aa1f7a80d8c58d 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -524,7 +524,7 @@ export class Workbench implements IPartService { // Layout if (!skipLayout) { - this.workbenchLayout.layout(true); + this.workbenchLayout.layout({ forceStyleReCompute: true }); } } @@ -544,7 +544,7 @@ export class Workbench implements IPartService { // Layout if (!skipLayout) { - this.workbenchLayout.layout(true); + this.workbenchLayout.layout({ forceStyleReCompute: true }); } // If sidebar becomes hidden, also hide the current active Viewlet if any @@ -587,7 +587,7 @@ export class Workbench implements IPartService { // Layout if (!skipLayout) { - this.workbenchLayout.layout(true); + this.workbenchLayout.layout({ forceStyleReCompute: true }); } // If panel part becomes hidden, also hide the current active panel if any @@ -615,7 +615,7 @@ export class Workbench implements IPartService { } public toggleMaximizedPanel(): void { - this.workbenchLayout.layout(true, true); + this.workbenchLayout.layout({ forceStyleReCompute: true, toggleMaximizedPanel: true }); } public getSideBarPosition(): Position { @@ -638,7 +638,7 @@ export class Workbench implements IPartService { this.sidebarPart.getContainer().addClass(newPositionValue); // Layout - this.workbenchLayout.layout(true); + this.workbenchLayout.layout({ forceStyleReCompute: true }); } public dispose(): void {