fix size constraints

上级 c4792762
...@@ -23,6 +23,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; ...@@ -23,6 +23,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { RepositoryRenderer } from 'vs/workbench/contrib/scm/browser/scmRepositoryRenderer'; import { RepositoryRenderer } from 'vs/workbench/contrib/scm/browser/scmRepositoryRenderer';
import { collectContextMenuActions, StatusBarAction, StatusBarActionViewItem } from 'vs/workbench/contrib/scm/browser/util'; import { collectContextMenuActions, StatusBarAction, StatusBarActionViewItem } from 'vs/workbench/contrib/scm/browser/util';
import { Orientation } from 'vs/base/browser/ui/sash/sash';
class ListDelegate implements IListVirtualDelegate<ISCMRepository> { class ListDelegate implements IListVirtualDelegate<ISCMRepository> {
...@@ -94,11 +95,13 @@ export class SCMRepositoriesViewPane extends ViewPane { ...@@ -94,11 +95,13 @@ export class SCMRepositoriesViewPane extends ViewPane {
this.onDidAddRepository(repository); this.onDidAddRepository(repository);
} }
this._register(this.configurationService.onDidChangeConfiguration(e => { if (this.orientation === Orientation.VERTICAL) {
if (e.affectsConfiguration('scm.repositories.visible')) { this._register(this.configurationService.onDidChangeConfiguration(e => {
this.updateBodySize(); if (e.affectsConfiguration('scm.repositories.visible')) {
} this.updateBodySize();
})); }
}));
}
this.updateListSelection(); this.updateListSelection();
} }
...@@ -128,6 +131,10 @@ export class SCMRepositoriesViewPane extends ViewPane { ...@@ -128,6 +131,10 @@ export class SCMRepositoriesViewPane extends ViewPane {
} }
private updateBodySize(): void { private updateBodySize(): void {
if (this.orientation === Orientation.HORIZONTAL) {
return;
}
const visibleCount = this.configurationService.getValue<number>('scm.repositories.visible'); const visibleCount = this.configurationService.getValue<number>('scm.repositories.visible');
const empty = this.list.length === 0; const empty = this.list.length === 0;
const size = Math.min(this.list.length, visibleCount) * 22; const size = Math.min(this.list.length, visibleCount) * 22;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册