From cfea97191c3819beab6e39b5b346c84026af4ba2 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 1 Feb 2018 15:27:57 +0100 Subject: [PATCH] fixes #41970 --- .../parts/scm/electron-browser/scmViewlet.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index d655a4096bf..5c37303fa04 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -990,6 +990,7 @@ export class SCMViewlet extends PanelViewlet implements IViewModel { private el: HTMLElement; private menus: SCMMenus; private mainPanel: MainPanel | null = null; + private cachedMainPanelHeight: number | undefined; private mainPanelDisposable: IDisposable = EmptyDisposable; private _repositories: ISCMRepository[] = []; private repositoryPanels: RepositoryPanel[] = []; @@ -1107,6 +1108,11 @@ export class SCMViewlet extends PanelViewlet implements IViewModel { setVisible(visible: boolean): TPromise { const result = super.setVisible(visible); + + if (!visible) { + this.cachedMainPanelHeight = this.getPanelSize(this.mainPanel); + } + this._onDidChangeVisibility.fire(visible); return result; } @@ -1195,6 +1201,12 @@ export class SCMViewlet extends PanelViewlet implements IViewModel { // Remove unselected panels panelsToRemove.forEach(panel => this.removePanel(panel)); + // Restore main panel height + if (this.isVisible() && typeof this.cachedMainPanelHeight === 'number') { + this.resizePanel(this.mainPanel, this.cachedMainPanelHeight); + this.cachedMainPanelHeight = undefined; + } + // Resize all panels equally const height = typeof this.height === 'number' ? this.height : 1000; const mainPanelHeight = this.getPanelSize(this.mainPanel); -- GitLab