mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
fix size constraints
This commit is contained in:
parent
c47927627c
commit
d4972e22a6
|
@ -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 {
|
||||||
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 {
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in a new issue