提交 2126e36f 编写于 作者: J Joao

fixes #33288

上级 8f8bbff3
......@@ -13,6 +13,15 @@
flex: 1;
}
.scm-viewlet .empty-message {
padding: 10px 22px 0 22px;
opacity: 0.5;
}
.scm-viewlet:not(.empty) .empty-message {
display: none;
}
.scm-viewlet .scm-status {
height: 100%;
}
......
......@@ -510,18 +510,21 @@ export class SCMViewlet extends PersistentViewsViewlet {
private onDidAddRepository(repository: ISCMRepository): void {
const view = new SourceControlViewDescriptor(repository);
ViewsRegistry.registerViews([view]);
toggleClass(this.getContainer().getHTMLElement(), 'empty', this.views.length === 0);
this.updateTitleArea();
}
private onDidRemoveRepository(repository: ISCMRepository): void {
ViewsRegistry.deregisterViews([repository.provider.id], ViewLocation.SCM);
toggleClass(this.getContainer().getHTMLElement(), 'empty', this.views.length === 0);
this.updateTitleArea();
}
async create(parent: Builder): TPromise<void> {
await super.create(parent);
parent.addClass('scm-viewlet');
parent.addClass('scm-viewlet', 'empty');
append(parent.getHTMLElement(), $('div.empty-message', null, localize('no open repo', "There are no source controls active.")));
this.scmService.onDidAddRepository(this.onDidAddRepository, this, this.disposables);
this.scmService.onDidRemoveRepository(this.onDidRemoveRepository, this, this.disposables);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册