This commit is contained in:
SteVen Batten
2020-06-03 15:28:53 -07:00
parent eed8f81686
commit ccf724d6c1
2 changed files with 18 additions and 1 deletions
@@ -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 {
@@ -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;
}