From 1c0b640a66a55b8d037646cde12b8b3c2a05f02e Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Wed, 12 Jul 2017 21:17:03 -0700 Subject: [PATCH] Collapse deployment view --- src/vs/workbench/parts/scm/electron-browser/deploymentView.ts | 1 + src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/scm/electron-browser/deploymentView.ts b/src/vs/workbench/parts/scm/electron-browser/deploymentView.ts index aa274cef9f9..fcecfa78a65 100644 --- a/src/vs/workbench/parts/scm/electron-browser/deploymentView.ts +++ b/src/vs/workbench/parts/scm/electron-browser/deploymentView.ts @@ -47,6 +47,7 @@ export class DeploymentView extends CollapsibleView { public static ID: string = 'workbench.deploymentView'; public static NAME = nls.localize('deployment', "Deployment"); + public static HEADER_HEIGHT = 22; public static HEIGHT = 80; private deploymentLink: HTMLAnchorElement; diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index 55844bf24ec..92f3373f859 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -333,6 +333,7 @@ export class SCMViewlet extends Viewlet { }; this.deploymentSplitView = new SplitView(root); const view = this.instantiationService.createInstance(DeploymentView, options); + this.disposables.push(view.addListener('change', () => this.layout())); this.deploymentSplitView.addView(view); this.disposables.push(this.deploymentSplitView); @@ -410,7 +411,7 @@ export class SCMViewlet extends Viewlet { this.inputBox.layout(); const editorHeight = this.inputBox.height; - const deploymentHeight = this.activeProvider && this.activeProvider.id === 'git' ? DeploymentView.HEIGHT : 0; + const deploymentHeight = this.activeProvider && this.activeProvider.id === 'git' ? (this.deploymentSplitView.getViews()[0].isExpanded() ? DeploymentView.HEIGHT : DeploymentView.HEADER_HEIGHT) : 0; const listHeight = dimension.height - (editorHeight + 12 /* margin */) - deploymentHeight; this.listContainer.style.height = `${listHeight}px`; this.list.layout(listHeight); -- GitLab