less flicker when opening first editor

This commit is contained in:
Benjamin Pasero
2016-12-14 09:13:27 +01:00
parent fc54fd5ce0
commit 8b1920e8ce
2 changed files with 10 additions and 4 deletions
@@ -5,15 +5,15 @@
/* Title Container */
.vs .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.tabs {
.vs .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.tabs.shows-tabs {
background: #F3F3F3;
}
.vs-dark .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.tabs {
.vs-dark .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.tabs.shows-tabs {
background: #252526;
}
.hc-black .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.tabs {
.hc-black .monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title.tabs.shows-tabs {
border-bottom: 1px solid #6FC3DF;
}
@@ -320,6 +320,7 @@ export class TabsTitleControl extends TitleControl {
this.tabDisposeables = dispose(this.tabDisposeables);
this.editorLabels = dispose(this.editorLabels);
DOM.removeClass(this.titleContainer, 'shows-tabs');
}
private refreshTabs(group: IEditorGroup): void {
@@ -330,7 +331,8 @@ export class TabsTitleControl extends TitleControl {
const tabContainers: HTMLElement[] = [];
// Add a tab for each opened editor
this.context.getEditors().forEach(editor => {
const editors = this.context.getEditors();
editors.forEach(editor => {
// Tab Container
const tabContainer = document.createElement('div');
@@ -366,6 +368,10 @@ export class TabsTitleControl extends TitleControl {
// Add to tabs container
tabContainers.forEach(tab => this.tabsContainer.appendChild(tab));
if (editors.length > 0) {
DOM.addClass(this.titleContainer, 'shows-tabs');
}
}
public layout(): void {