Skip to content

Commit b72f45c

Browse files
committed
add breadcrumb.background, microsoft#55960
1 parent 34a667a commit b72f45c

6 files changed

Lines changed: 10 additions & 14 deletions

File tree

src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ export class SimpleBreadcrumbsItem extends BreadcrumbsItem {
4545
export interface IBreadcrumbsWidgetStyles {
4646
breadcrumbsBackground?: Color;
4747
breadcrumbsForeground?: Color;
48-
breadcrumbsHoverBackground?: Color;
4948
breadcrumbsHoverForeground?: Color;
5049
breadcrumbsFocusForeground?: Color;
51-
breadcrumbsFocusAndSelectionBackground?: Color;
5250
breadcrumbsFocusAndSelectionForeground?: Color;
5351
}
5452

@@ -135,15 +133,9 @@ export class BreadcrumbsWidget {
135133
if (style.breadcrumbsFocusForeground) {
136134
content += `.monaco-breadcrumbs .monaco-breadcrumb-item.focused { color: ${style.breadcrumbsFocusForeground}}\n`;
137135
}
138-
if (style.breadcrumbsFocusAndSelectionBackground) {
139-
content += `.monaco-breadcrumbs .monaco-breadcrumb-item.focused.selected { background-color: ${style.breadcrumbsFocusAndSelectionBackground}}\n`;
140-
}
141136
if (style.breadcrumbsFocusAndSelectionForeground) {
142137
content += `.monaco-breadcrumbs .monaco-breadcrumb-item.focused.selected { color: ${style.breadcrumbsFocusAndSelectionForeground}}\n`;
143138
}
144-
if (style.breadcrumbsHoverBackground) {
145-
content += `.monaco-breadcrumbs .monaco-breadcrumb-item:hover:not(.focused):not(.selected) { background-color: ${style.breadcrumbsHoverBackground}}\n`;
146-
}
147139
if (style.breadcrumbsHoverForeground) {
148140
content += `.monaco-breadcrumbs .monaco-breadcrumb-item:hover:not(.focused):not(.selected) { color: ${style.breadcrumbsHoverForeground}}\n`;
149141
}

src/vs/platform/theme/common/colorRegistry.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.ac
224224
export const progressBarBackground = registerColor('progressBar.background', { dark: Color.fromHex('#0E70C0'), light: Color.fromHex('#0E70C0'), hc: contrastBorder }, nls.localize('progressBarBackground', "Background color of the progress bar that can show for long running operations."));
225225

226226
export const breadcrumbsForeground = registerColor('breadcrumb.foreground', { light: Color.fromHex('#6C6C6C').transparent(.7), dark: Color.fromHex('#CCCCCC').transparent(.7), hc: Color.white.transparent(.7) }, nls.localize('breadcrumbsFocusForeground', "Color of focused breadcrumb items."));
227+
export const breadcrumbsBackground = registerColor('breadcrumb.brackground', { light: '#fffffe', dark: '#1E1E1E', hc: Color.black }, nls.localize('breadcrumbsBackground', "Background color of breadcrumb items."));
227228
export const breadcrumbsFocusForeground = registerColor('breadcrumb.focusForeground', { light: '#6C6C6C', dark: '#CCCCCC', hc: Color.white }, nls.localize('breadcrumbsFocusForeground', "Color of focused breadcrumb items."));
228229
export const breadcrumbsActiveSelectionForeground = registerColor('breadcrumb.activeSelectionForeground', { light: '#6C6C6C', dark: '#CCCCCC', hc: Color.white }, nls.localize('breadcrumbsSelectedForegound', "Color of selected breadcrumb items."));
229230
export const breadcrumbsPickerBackground = registerColor('breadcrumbPicker.background', { light: '#ECECEC', dark: '#252526', hc: Color.black }, nls.localize('breadcrumbsSelectedBackground', "Background color of breadcrumb item picker."));

src/vs/platform/theme/common/styler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
'use strict';
77

88
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
9-
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry';
9+
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground } from 'vs/platform/theme/common/colorRegistry';
1010
import { IDisposable } from 'vs/base/common/lifecycle';
1111
import { Color } from 'vs/base/common/color';
1212
import { mixin } from 'vs/base/common/objects';
@@ -272,7 +272,7 @@ export interface IBreadcrumbsWidgetStyleOverrides extends IStyleOverrides {
272272
}
273273

274274
export const defaultBreadcrumbsStyles = <IBreadcrumbsWidgetStyleOverrides>{
275-
breadcrumbsBackground: editorBackground,
275+
breadcrumbsBackground: breadcrumbsBackground,
276276
breadcrumbsForeground: breadcrumbsForeground,
277277
breadcrumbsHoverForeground: breadcrumbsFocusForeground,
278278
breadcrumbsFocusForeground: breadcrumbsFocusForeground,

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import { localize } from 'vs/nls';
4040
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
4141
import { tail } from 'vs/base/common/arrays';
4242
import { WorkbenchListFocusContextKey } from 'vs/platform/list/browser/listService';
43+
import { ColorIdentifier } from 'vs/platform/theme/common/colorRegistry';
4344

4445
class Item extends BreadcrumbsItem {
4546

@@ -117,6 +118,7 @@ export interface IBreadcrumbsControlOptions {
117118
showSymbolIcons: boolean;
118119
showDecorationColors: boolean;
119120
extraClasses: string[];
121+
breadcrumbsBackground: ColorIdentifier;
120122
}
121123

122124
export class BreadcrumbsControl {
@@ -167,7 +169,7 @@ export class BreadcrumbsControl {
167169
this._widget.onDidSelectItem(this._onSelectEvent, this, this._disposables);
168170
this._widget.onDidFocusItem(this._onFocusEvent, this, this._disposables);
169171
this._widget.onDidChangeFocus(this._updateCkBreadcrumbsActive, this, this._disposables);
170-
this._disposables.push(attachBreadcrumbsStyler(this._widget, this._themeService));
172+
this._disposables.push(attachBreadcrumbsStyler(this._widget, this._themeService, { breadcrumbsBackground: _options.breadcrumbsBackground }));
171173

172174
this._ckBreadcrumbsVisible = BreadcrumbsControl.CK_BreadcrumbsVisible.bindTo(this._contextKeyService);
173175
this._ckBreadcrumbsActive = BreadcrumbsControl.CK_BreadcrumbsActive.bindTo(this._contextKeyService);

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { addDisposableListener, EventType, addClass, EventHelper, removeClass, t
1515
import { IEditorPartOptions, EDITOR_TITLE_HEIGHT } from 'vs/workbench/browser/parts/editor/editor';
1616
import { IAction } from 'vs/base/common/actions';
1717
import { CLOSE_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands';
18+
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
1819

1920
export class NoTabsTitleControl extends TitleControl {
2021
private titleContainer: HTMLElement;
@@ -40,7 +41,7 @@ export class NoTabsTitleControl extends TitleControl {
4041
this._register(this.editorLabel.onClick(e => this.onTitleLabelClick(e)));
4142

4243
// Breadcrumbs
43-
this.createBreadcrumbsControl(labelContainer, { showFileIcons: false, showSymbolIcons: true, showDecorationColors: false, extraClasses: ['no-tabs-breadcrumbs'] });
44+
this.createBreadcrumbsControl(labelContainer, { showFileIcons: false, showSymbolIcons: true, showDecorationColors: false, extraClasses: ['no-tabs-breadcrumbs'], breadcrumbsBackground: editorBackground });
4445

4546
// Right Actions Container
4647
const actionsContainer = document.createElement('div');

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable';
2828
import { getOrSet } from 'vs/base/common/map';
2929
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
3030
import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, WORKBENCH_BACKGROUND, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP } from 'vs/workbench/common/theme';
31-
import { activeContrastBorder, contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
31+
import { activeContrastBorder, contrastBorder, editorBackground, breadcrumbsBackground } from 'vs/platform/theme/common/colorRegistry';
3232
import { ResourcesDropHandler, fillResourceDataTransfers, DraggedEditorIdentifier, DraggedEditorGroupIdentifier, DragAndDropObserver } from 'vs/workbench/browser/dnd';
3333
import { Color } from 'vs/base/common/color';
3434
import { INotificationService } from 'vs/platform/notification/common/notification';
@@ -116,7 +116,7 @@ export class TabsTitleControl extends TitleControl {
116116
const breadcrumbsContainer = document.createElement('div');
117117
addClass(breadcrumbsContainer, 'tabs-breadcrumbs');
118118
this.titleContainer.appendChild(breadcrumbsContainer);
119-
this.createBreadcrumbsControl(breadcrumbsContainer, { showFileIcons: true, showSymbolIcons: true, showDecorationColors: false, extraClasses: [] });
119+
this.createBreadcrumbsControl(breadcrumbsContainer, { showFileIcons: true, showSymbolIcons: true, showDecorationColors: false, extraClasses: [], breadcrumbsBackground: breadcrumbsBackground });
120120
}
121121

122122
private createScrollbar(): void {

0 commit comments

Comments
 (0)