Skip to content

Commit 80a30a3

Browse files
author
Miguel Solorio
committed
Support standalone editor quick pick changes
1 parent a5f2347 commit 80a30a3

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

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

+8-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, quickInputListFocusForeground } 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';
@@ -43,6 +43,7 @@ export const editorSuggestWidgetForeground = registerColor('editorSuggestWidget.
4343
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.'));
4444
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.'));
4545
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.'));
4647

4748
const enum State {
4849
Hidden,
@@ -973,6 +974,12 @@ registerThemingParticipant((theme, collector) => {
973974
if (matchHighlight) {
974975
collector.addRule(`.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-highlighted-label .highlight { color: ${matchHighlight}; }`);
975976
}
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+
976983
const foreground = theme.getColor(editorSuggestWidgetForeground);
977984
if (foreground) {
978985
collector.addRule(`.monaco-editor .suggest-widget, .monaco-editor .suggest-details { color: ${foreground}; }`);

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+
.quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight,
16+
.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

+5-3
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 -------------------------------- */
@@ -144,7 +145,8 @@ export const vs_dark: IStandaloneThemeData = {
144145
[editorInactiveSelection]: '#3A3D41',
145146
[editorIndentGuides]: '#404040',
146147
[editorActiveIndentGuides]: '#707070',
147-
[editorSelectionHighlight]: '#ADD6FF26'
148+
[editorSelectionHighlight]: '#ADD6FF26',
149+
[listFocusHighlightForeground]: '#ff0000'
148150
}
149151
};
150152
/* -------------------------------- End vs-dark theme -------------------------------- */

src/vs/workbench/browser/style.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ registerThemingParticipant((theme, collector) => {
6363

6464
// List highlight w/ focus
6565
const listHighlightFocusForegroundColor = theme.getColor(listFocusHighlightForeground);
66-
if (listHighlightForegroundColor) {
66+
if (listHighlightFocusForegroundColor) {
6767
collector.addRule(`
6868
.monaco-workbench .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight {
6969
color: ${listHighlightFocusForegroundColor} !important;

0 commit comments

Comments
 (0)