Skip to content

Commit a970588

Browse files
committed
grid - retire editorGroup.background and add new colors for empty groups
1 parent b4b420f commit a970588

File tree

12 files changed

+33
-26
lines changed

12 files changed

+33
-26
lines changed

extensions/theme-abyss/themes/abyss-color-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@
365365
// Workbench: Editors
366366
// "editorGroupHeader.noTabsBackground": "",
367367
"editorGroup.border": "#2b2b4a",
368-
"editorGroup.background": "#1c1c2a",
369368
"editorGroup.dropBackground": "#25375daa",
370369
"editorGroupHeader.tabsBackground": "#1c1c2a",
371370

extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"editorWidget.background": "#131510",
2020
"editorHoverWidget.background": "#221a14",
2121
"editorGroupHeader.tabsBackground": "#131510",
22-
"editorGroup.background": "#0f0c08",
2322
"editorLineNumber.activeForeground": "#adadad",
2423
"tab.inactiveBackground": "#131510",
2524
"titleBar.activeBackground": "#423523",

extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"editorIndentGuide.background": "#505037",
2222
"editorIndentGuide.activeBackground": "#707057",
2323
"editorGroupHeader.tabsBackground": "#282828",
24-
"editorGroup.background": "#1e1e1e",
2524
"tab.inactiveBackground": "#404040",
2625
"tab.border": "#303030",
2726
"tab.inactiveForeground": "#d8d8d8",

extensions/theme-red/themes/Red-color-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// editor
1616
"editor.background": "#390000",
1717
"editorGroup.border": "#ff666633",
18-
"editorGroup.background": "#1c0101",
1918
"editorCursor.foreground": "#970000",
2019
"editor.foreground": "#F8F8F8",
2120
"editorWhitespace.foreground": "#c10000",

extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@
413413
// Workbench: Editors
414414
// "editorGroupHeader.noTabsBackground": "",
415415
"editorGroup.border": "#00212B",
416-
"editorGroup.background": "#011b23",
417416
"editorGroup.dropBackground": "#2AA19844",
418417
"editorGroupHeader.tabsBackground": "#004052",
419418

extensions/theme-solarized-light/themes/solarized-light-color-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@
409409
// Workbench: Editors
410410
// "editorGroupHeader.noTabsBackground": "",
411411
"editorGroup.border": "#DDD6C1",
412-
"editorGroup.background": "#FFFBF2",
413412
"editorGroup.dropBackground": "#DDD6C1AA",
414413
"editorGroupHeader.tabsBackground": "#D9D2C2",
415414

extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"editorHoverWidget.border": "#ffffff44",
2424
"editorGroup.border": "#404f7d",
2525
"editorGroupHeader.tabsBackground": "#001733",
26-
"editorGroup.background": "#1c1c2a",
2726
"editorGroup.dropBackground": "#25375daa",
2827
"peekViewResult.background": "#001c40",
2928
"tab.inactiveBackground": "#001c40",

src/vs/workbench/browser/parts/editor/editorGroupsControl.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup, EditorOption
3030
import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService';
3131
import { IThemeService } from 'vs/platform/theme/common/themeService';
3232
import { editorBackground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
33-
import { Themable, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER } from 'vs/workbench/common/theme';
33+
import { Themable, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER } from 'vs/workbench/common/theme';
3434
import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
3535
import { IDisposable } from 'vs/base/common/lifecycle';
3636
import { ResourcesDropHandler, LocalSelectionTransfer, DraggedEditorIdentifier } from 'vs/workbench/browser/dnd';
@@ -1660,8 +1660,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
16601660
}
16611661

16621662
private updateFromDragAndDrop(element: HTMLElement, isDraggedOver: boolean): void {
1663-
const groupCount = this.stacks.groups.length;
1664-
const background = this.getColor(isDraggedOver ? EDITOR_DRAG_AND_DROP_BACKGROUND : groupCount > 0 ? EDITOR_GROUP_BACKGROUND : null);
1663+
const background = this.getColor(EDITOR_DRAG_AND_DROP_BACKGROUND);
16651664
element.style.backgroundColor = background;
16661665

16671666
const activeContrastBorderColor = this.getColor(activeContrastBorder);

src/vs/workbench/browser/parts/editor/editorPart.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { Event, Emitter, once } from 'vs/base/common/event';
3838
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
3939
import { IThemeService } from 'vs/platform/theme/common/themeService';
4040
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
41-
import { EDITOR_GROUP_BACKGROUND } from 'vs/workbench/common/theme';
4241
import { createCSSRule, Dimension, addClass, removeClass } from 'vs/base/browser/dom';
4342
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
4443
import { join } from 'vs/base/common/paths';
@@ -1457,8 +1456,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
14571456
} else {
14581457
removeClass(content, 'multiple-groups');
14591458
}
1460-
1461-
content.style.backgroundColor = groupCount > 0 ? this.getColor(EDITOR_GROUP_BACKGROUND) : null;
14621459
}
14631460

14641461
public activateGroup(group: EditorGroup): void;

src/vs/workbench/browser/parts/editor2/nextEditorGroupView.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';
1818
import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
1919
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
2020
import { editorBackground, contrastBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
21-
import { Themable, EDITOR_GROUP_HEADER_TABS_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND } from 'vs/workbench/common/theme';
21+
import { Themable, EDITOR_GROUP_HEADER_TABS_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_ACTIVE_EMPTY_BACKGROUND, EDITOR_GROUP_EMPTY_BACKGROUND } from 'vs/workbench/common/theme';
2222
import { IMoveEditorOptions, ICopyEditorOptions } from 'vs/workbench/services/group/common/nextEditorGroupsService';
2323
import { NextTabsTitleControl } from 'vs/workbench/browser/parts/editor2/nextTabsTitleControl';
2424
import { NextEditorControl } from 'vs/workbench/browser/parts/editor2/nextEditorControl';
@@ -85,6 +85,7 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
8585

8686
private _group: EditorGroup;
8787

88+
private active: boolean;
8889
private _dimension: Dimension;
8990
private _whenRestored: Thenable<void>;
9091

@@ -173,15 +174,15 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
173174
// Editor control
174175
this.editorControl = this._register(this.scopedInstantiationService.createInstance(NextEditorControl, this.editorContainer, this._group.id));
175176

176-
// Update styles
177-
this.updateStyles();
177+
// Track Focus
178+
this.doTrackFocus();
178179

179180
// Update containers
180181
this.updateTitleContainer();
181182
this.updateContainer();
182183

183-
// Track Focus
184-
this.doTrackFocus();
184+
// Update styles
185+
this.updateStyles();
185186
}
186187

187188
private doTrackFocus(): void {
@@ -241,6 +242,9 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
241242
this.element.removeAttribute('tabIndex');
242243
this.element.removeAttribute('aria-label');
243244
}
245+
246+
// Update styles
247+
this.updateStyles();
244248
}
245249

246250
private updateTitleContainer(): void {
@@ -448,13 +452,17 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
448452
}
449453

450454
setActive(isActive: boolean): void {
455+
this.active = isActive;
451456

452457
// Update container
453458
toggleClass(this.element, 'active', isActive);
454459
toggleClass(this.element, 'inactive', !isActive);
455460

456461
// Update title control
457462
this.titleAreaControl.setActive(isActive);
463+
464+
// Update styles
465+
this.updateStyles();
458466
}
459467

460468
isEmpty(): boolean {
@@ -887,6 +895,11 @@ export class NextEditorGroupView extends Themable implements INextEditorGroupVie
887895

888896
// Container
889897
this.element.style.outlineColor = this.getColor(focusBorder);
898+
if (this.isEmpty()) {
899+
this.element.style.backgroundColor = this.getColor(this.active ? EDITOR_GROUP_ACTIVE_EMPTY_BACKGROUND : EDITOR_GROUP_EMPTY_BACKGROUND);
900+
} else {
901+
this.element.style.backgroundColor = null;
902+
}
890903

891904
// Title control
892905
const { showTabs } = this.accessor.partOptions;

0 commit comments

Comments
 (0)