Skip to content

Commit fe23c20

Browse files
author
Miguel Solorio
authored
Merge pull request microsoft#122893 from microsoft/misolori/quick-pick-list-update
Update quick pick list widget focus colors
2 parents 052fb6d + 85a0078 commit fe23c20

File tree

10 files changed

+58
-11
lines changed

10 files changed

+58
-11
lines changed

extensions/theme-defaults/themes/light_vs.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"tab.lastPinnedBorder": "#61616130",
2525
"notebook.cellBorderColor": "#E8E8E8",
2626
"notebook.selectedCellBackground": "#c8ddf150",
27-
"statusBarItem.errorBackground": "#c72e0f"
27+
"statusBarItem.errorBackground": "#c72e0f",
28+
"list.focusHighlightForeground": "#33B6FF"
2829
},
2930
"tokenColors": [
3031
{

src/vs/base/parts/quickinput/browser/media/quickInput.css

+11
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,14 @@
276276
.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label {
277277
display: flex;
278278
}
279+
280+
/* focused items in quick pick */
281+
.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,
282+
.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator,
283+
.quick-input-list .monaco-list-row.focused .quick-input-list-rows .quick-input-list-row .codicon,
284+
.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .codicon {
285+
color: inherit
286+
}
287+
.quick-input-list .monaco-list-row.focused .monaco-keybinding-key {
288+
background: none;
289+
}

src/vs/editor/contrib/suggest/media/suggest.css

+4
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@
306306
margin-right: 4px;
307307
}
308308

309+
.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .suggest-icon {
310+
color: inherit;
311+
}
312+
309313
.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon, .monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon::before {
310314
display: none;
311315
}

src/vs/editor/contrib/suggest/suggestWidget.ts

+14-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { Context as SuggestContext, CompletionItem } from './suggest';
2121
import { CompletionModel } from './completionModel';
2222
import { attachListStyler } from 'vs/platform/theme/common/styler';
2323
import { IThemeService, IColorTheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
24-
import { registerColor, editorWidgetBackground, quickInputListFocusBackground, activeContrastBorder, listHighlightForeground, editorForeground, editorWidgetBorder, focusBorder, textLinkForeground, textCodeBlockBackground } from 'vs/platform/theme/common/colorRegistry';
24+
import { registerColor, editorWidgetBackground, quickInputListFocusBackground, activeContrastBorder, listHighlightForeground, editorForeground, editorWidgetBorder, focusBorder, textLinkForeground, textCodeBlockBackground, quickInputListFocusForeground, listFocusHighlightForeground } from 'vs/platform/theme/common/colorRegistry';
2525
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
2626
import { TimeoutTimer, CancelablePromise, createCancelablePromise, disposableTimeout } from 'vs/base/common/async';
2727
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
@@ -40,8 +40,10 @@ import { clamp } from 'vs/base/common/numbers';
4040
export const editorSuggestWidgetBackground = registerColor('editorSuggestWidget.background', { dark: editorWidgetBackground, light: editorWidgetBackground, hc: editorWidgetBackground }, nls.localize('editorSuggestWidgetBackground', 'Background color of the suggest widget.'));
4141
export const editorSuggestWidgetBorder = registerColor('editorSuggestWidget.border', { dark: editorWidgetBorder, light: editorWidgetBorder, hc: editorWidgetBorder }, nls.localize('editorSuggestWidgetBorder', 'Border color of the suggest widget.'));
4242
export const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.foreground', { dark: editorForeground, light: editorForeground, hc: editorForeground }, nls.localize('editorSuggestWidgetForeground', 'Foreground color of the suggest widget.'));
43+
export const editorSuggestWidgetSelectedForeground = registerColor('editorSuggestWidget.selectedForeground', { dark: quickInputListFocusForeground, light: quickInputListFocusForeground, hc: quickInputListFocusForeground }, nls.localize('editorSuggestWidgetSelectedForeground', 'Foreground color of the selected entry in the suggest widget.'));
4344
export const editorSuggestWidgetSelectedBackground = registerColor('editorSuggestWidget.selectedBackground', { dark: quickInputListFocusBackground, light: quickInputListFocusBackground, hc: quickInputListFocusBackground }, nls.localize('editorSuggestWidgetSelectedBackground', 'Background color of the selected entry in the suggest widget.'));
4445
export const editorSuggestWidgetHighlightForeground = registerColor('editorSuggestWidget.highlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hc: listHighlightForeground }, nls.localize('editorSuggestWidgetHighlightForeground', 'Color of the match highlights in the suggest widget.'));
46+
export const editorSuggestWidgetHighlightFocusForeground = registerColor('editorSuggestWidget.focusHighlightForeground', { dark: listFocusHighlightForeground, light: listFocusHighlightForeground, hc: listFocusHighlightForeground }, nls.localize('editorSuggestWidgetFocusHighlightForeground', 'Color of the match highlights in the suggest widget when an item is focused.'));
4547

4648
const enum State {
4749
Hidden,
@@ -972,11 +974,22 @@ registerThemingParticipant((theme, collector) => {
972974
if (matchHighlight) {
973975
collector.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${matchHighlight}; }`);
974976
}
977+
978+
const matchHighlightFocus = theme.getColor(editorSuggestWidgetHighlightFocusForeground);
979+
if (matchHighlight) {
980+
collector.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight { color: ${matchHighlightFocus}; }`);
981+
}
982+
975983
const foreground = theme.getColor(editorSuggestWidgetForeground);
976984
if (foreground) {
977985
collector.addRule(`.monaco-editor .suggest-widget, .monaco-editor .suggest-details { color: ${foreground}; }`);
978986
}
979987

988+
const selectedForeground = theme.getColor(editorSuggestWidgetSelectedForeground);
989+
if (selectedForeground) {
990+
collector.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused { color: ${selectedForeground}; }`);
991+
}
992+
980993
const link = theme.getColor(textLinkForeground);
981994
if (link) {
982995
collector.addRule(`.monaco-editor .suggest-details a { color: ${link}; }`);

src/vs/editor/standalone/browser/quickInput/standaloneQuickInput.css

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
color: #0066BF;
1313
}
1414

15+
.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,
16+
.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight {
17+
color: #33B6FF;
18+
}
19+
1520
.vs-dark .quick-input-widget .monaco-highlighted-label .highlight,
1621
.vs-dark .quick-input-widget .monaco-highlighted-label .highlight {
1722
color: #0097fb;

src/vs/editor/standalone/common/themes.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { editorActiveIndentGuides, editorIndentGuides } from 'vs/editor/common/view/editorColorRegistry';
77
import { IStandaloneThemeData } from 'vs/editor/standalone/common/standaloneThemeService';
8-
import { editorBackground, editorForeground, editorInactiveSelection, editorSelectionHighlight } from 'vs/platform/theme/common/colorRegistry';
8+
import { editorBackground, editorForeground, editorInactiveSelection, editorSelectionHighlight, listFocusHighlightForeground } from 'vs/platform/theme/common/colorRegistry';
99

1010
/* -------------------------------- Begin vs theme -------------------------------- */
1111
export const vs: IStandaloneThemeData = {
@@ -73,7 +73,8 @@ export const vs: IStandaloneThemeData = {
7373
[editorInactiveSelection]: '#E5EBF1',
7474
[editorIndentGuides]: '#D3D3D3',
7575
[editorActiveIndentGuides]: '#939393',
76-
[editorSelectionHighlight]: '#ADD6FF4D'
76+
[editorSelectionHighlight]: '#ADD6FF4D',
77+
[listFocusHighlightForeground]: '#33B6FF'
7778
}
7879
};
7980
/* -------------------------------- End vs theme -------------------------------- */

src/vs/platform/quickinput/browser/quickInput.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { IQuickInputService, IQuickPickItem, IPickOptions, IInputOptions, IQuick
77
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
88
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
99
import { IThemeService, Themable } from 'vs/platform/theme/common/themeService';
10-
import { inputBackground, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder, badgeBackground, badgeForeground, contrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, progressBarBackground, widgetShadow, listFocusForeground, activeContrastBorder, pickerGroupBorder, pickerGroupForeground, quickInputForeground, quickInputBackground, quickInputTitleBackground, quickInputListFocusBackground, keybindingLabelBackground, keybindingLabelForeground, keybindingLabelBorder, keybindingLabelBottomBorder } from 'vs/platform/theme/common/colorRegistry';
10+
import { inputBackground, inputForeground, inputBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationInfoBorder, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationWarningBorder, inputValidationErrorBackground, inputValidationErrorForeground, inputValidationErrorBorder, badgeBackground, badgeForeground, contrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, progressBarBackground, widgetShadow, activeContrastBorder, pickerGroupBorder, pickerGroupForeground, quickInputForeground, quickInputBackground, quickInputTitleBackground, quickInputListFocusBackground, keybindingLabelBackground, keybindingLabelForeground, keybindingLabelBorder, keybindingLabelBottomBorder, quickInputListFocusForeground } from 'vs/platform/theme/common/colorRegistry';
1111
import { CancellationToken } from 'vs/base/common/cancellation';
1212
import { computeStyles } from 'vs/platform/theme/common/styler';
1313
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
@@ -219,7 +219,7 @@ export class QuickInputService extends Themable implements IQuickInputService {
219219
list: computeStyles(this.theme, {
220220
listBackground: quickInputBackground,
221221
// Look like focused when inactive.
222-
listInactiveFocusForeground: listFocusForeground,
222+
listInactiveFocusForeground: quickInputListFocusForeground,
223223
listInactiveFocusBackground: quickInputListFocusBackground,
224224
listFocusOutline: activeContrastBorder,
225225
listInactiveFocusOutline: activeContrastBorder,

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ export const listInactiveFocusOutline = registerColor('list.inactiveFocusOutline
383383
export const listHoverBackground = registerColor('list.hoverBackground', { dark: '#2A2D2E', light: '#F0F0F0', hc: null }, nls.localize('listHoverBackground', "List/Tree background when hovering over items using the mouse."));
384384
export const listHoverForeground = registerColor('list.hoverForeground', { dark: null, light: null, hc: null }, nls.localize('listHoverForeground', "List/Tree foreground when hovering over items using the mouse."));
385385
export const listDropBackground = registerColor('list.dropBackground', { dark: '#062F4A', light: '#D6EBFF', hc: null }, nls.localize('listDropBackground', "List/Tree drag and drop background when moving items around using the mouse."));
386-
export const listHighlightForeground = registerColor('list.highlightForeground', { dark: '#0097fb', light: '#0066BF', hc: focusBorder }, nls.localize('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.'));
386+
export const listHighlightForeground = registerColor('list.highlightForeground', { dark: '#18A3FF', light: '#0066BF', hc: focusBorder }, nls.localize('highlight', 'List/Tree foreground color of the match highlights when searching inside the list/tree.'));
387+
export const listFocusHighlightForeground = registerColor('list.focusHighlightForeground', { dark: listHighlightForeground, light: listHighlightForeground, hc: listHighlightForeground }, nls.localize('listFocusHighlightForeground', 'List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree.'));
387388
export const listInvalidItemForeground = registerColor('list.invalidItemForeground', { dark: '#B89500', light: '#B89500', hc: '#B89500' }, nls.localize('invalidItemForeground', 'List/Tree foreground color for invalid items, for example an unresolved root in explorer.'));
388389
export const listErrorForeground = registerColor('list.errorForeground', { dark: '#F88070', light: '#B01011', hc: null }, nls.localize('listErrorForeground', 'Foreground color of list items containing errors.'));
389390
export const listWarningForeground = registerColor('list.warningForeground', { dark: '#CCA700', light: '#855F00', hc: null }, nls.localize('listWarningForeground', 'Foreground color of list items containing warnings.'));
@@ -400,7 +401,8 @@ export const listDeemphasizedForeground = registerColor('list.deemphasizedForegr
400401
* Quick pick widget (dependent on List and tree colors)
401402
*/
402403
export const _deprecatedQuickInputListFocusBackground = registerColor('quickInput.list.focusBackground', { dark: null, light: null, hc: null }, '', undefined, nls.localize('quickInput.list.focusBackground deprecation', "Please use quickInputList.focusBackground instead"));
403-
export const quickInputListFocusBackground = registerColor('quickInputList.focusBackground', { dark: oneOf(_deprecatedQuickInputListFocusBackground, listFocusBackground, '#062F4A'), light: oneOf(_deprecatedQuickInputListFocusBackground, listFocusBackground, '#D6EBFF'), hc: null }, nls.localize('quickInput.listFocusBackground', "Quick picker background color for the focused item."));
404+
export const quickInputListFocusForeground = registerColor('quickInputList.focusForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hc: listActiveSelectionForeground }, nls.localize('quickInput.listFocusForeground', "Quick picker foreground color for the focused item."));
405+
export const quickInputListFocusBackground = registerColor('quickInputList.focusBackground', { dark: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground, '#062F4A'), light: oneOf(_deprecatedQuickInputListFocusBackground, listActiveSelectionBackground, '#D6EBFF'), hc: null }, nls.localize('quickInput.listFocusBackground', "Quick picker background color for the focused item."));
404406

405407
/**
406408
* Menu colors

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { IColorTheme, IThemeService } from 'vs/platform/theme/common/themeService';
7-
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, contrastBorder, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetBackground, editorWidgetBackground, treeIndentGuidesStroke, editorWidgetForeground, simpleCheckboxBackground, simpleCheckboxBorder, simpleCheckboxForeground, ColorValue, resolveColorValue, textLinkForeground, problemsWarningIconForeground, problemsErrorIconForeground, problemsInfoIconForeground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, listFocusOutline, listInactiveFocusOutline, tableColumnsBorder, quickInputListFocusBackground, buttonBorder, keybindingLabelForeground, keybindingLabelBackground, keybindingLabelBorder, keybindingLabelBottomBorder } from 'vs/platform/theme/common/colorRegistry';
7+
import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, contrastBorder, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetBackground, editorWidgetBackground, treeIndentGuidesStroke, editorWidgetForeground, simpleCheckboxBackground, simpleCheckboxBorder, simpleCheckboxForeground, ColorValue, resolveColorValue, textLinkForeground, problemsWarningIconForeground, problemsErrorIconForeground, problemsInfoIconForeground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, listFocusOutline, listInactiveFocusOutline, tableColumnsBorder, quickInputListFocusBackground, buttonBorder, keybindingLabelForeground, keybindingLabelBackground, keybindingLabelBorder, keybindingLabelBottomBorder, quickInputListFocusForeground } from 'vs/platform/theme/common/colorRegistry';
88
import { IDisposable } from 'vs/base/common/lifecycle';
99
import { Color } from 'vs/base/common/color';
1010
import { IThemable, styleFn } from 'vs/base/common/styler';
@@ -130,7 +130,7 @@ export function attachSelectBoxStyler(widget: IThemable, themeService: IThemeSer
130130
selectBorder: style?.selectBorder || selectBorder,
131131
focusBorder: style?.focusBorder || focusBorder,
132132
listFocusBackground: style?.listFocusBackground || quickInputListFocusBackground,
133-
listFocusForeground: style?.listFocusForeground || listFocusForeground,
133+
listFocusForeground: style?.listFocusForeground || quickInputListFocusForeground,
134134
listFocusOutline: style?.listFocusOutline || ((theme: IColorTheme) => theme.type === ColorScheme.HIGH_CONTRAST ? activeContrastBorder : Color.transparent),
135135
listHoverBackground: style?.listHoverBackground || listHoverBackground,
136136
listHoverForeground: style?.listHoverForeground || listHoverForeground,

0 commit comments

Comments
 (0)