From ccf724d6c13b07ddbcde96eeb4b400283f2e7fda Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 3 Jun 2020 15:28:53 -0700 Subject: [PATCH] fixes #99200 --- .../workbench/contrib/debug/browser/breakpointsView.ts | 9 ++++++++- .../contrib/files/browser/views/openEditorsView.ts | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index 8a691c2ccb1..b49fc1f8ae3 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -154,6 +154,11 @@ export class BreakpointsView extends ViewPane { this.onBreakpointsChange(); } })); + + const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!; + this._register(containerModel.onDidChangeAllViewDescriptors(() => { + this.updateSize(); + })); } public focus(): void { @@ -237,9 +242,11 @@ export class BreakpointsView extends ViewPane { } private updateSize(): void { + const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!; + // Adjust expanded body size this.minimumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel(), MAX_VISIBLE_BREAKPOINTS) : 170; - this.maximumBodySize = this.orientation === Orientation.VERTICAL ? getExpandedBodySize(this.debugService.getModel(), Number.POSITIVE_INFINITY) : Number.POSITIVE_INFINITY; + this.maximumBodySize = this.orientation === Orientation.VERTICAL && containerModel.visibleViewDescriptors.length > 1 ? getExpandedBodySize(this.debugService.getModel(), Number.POSITIVE_INFINITY) : Number.POSITIVE_INFINITY; } private onBreakpointsChange(): void { diff --git a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts index dfdbc4bac2c..9b71a03b912 100644 --- a/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/browser/views/openEditorsView.ts @@ -303,6 +303,11 @@ export class OpenEditorsView extends ViewPane { this.listRefreshScheduler.schedule(0); } })); + + const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!; + this._register(containerModel.onDidChangeAllViewDescriptors(() => { + this.updateSize(); + })); } getActions(): IAction[] { @@ -446,6 +451,11 @@ export class OpenEditorsView extends ViewPane { } private getMaxExpandedBodySize(): number { + const containerModel = this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerByViewId(this.id)!)!; + if (containerModel.visibleViewDescriptors.length <= 1) { + return Number.POSITIVE_INFINITY; + } + return this.elementCount * OpenEditorsDelegate.ITEM_HEIGHT; } -- GitLab