From a0b4c5c77b2ab594db07d9e7f01e3a13898c3164 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Thu, 29 Mar 2018 16:34:15 +0200 Subject: [PATCH] Overwrite inactive focus and selection colors (fixes #46924) --- .../browser/parts/quickinput/quickInput.ts | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index c980d5e8c96..2ab6fe258fa 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -13,7 +13,7 @@ import { Dimension } from 'vs/base/browser/builder'; import * as dom from 'vs/base/browser/dom'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { registerThemingParticipant, ITheme, ICssStyleCollector, IThemeService } from 'vs/platform/theme/common/themeService'; -import { buttonBackground, buttonForeground, contrastBorder, buttonHoverBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; +import { buttonBackground, buttonForeground, contrastBorder, buttonHoverBackground, widgetShadow, listFocusBackground, listActiveSelectionBackground, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme'; import { IQuickOpenService, IPickOpenEntry, IPickOptions } from 'vs/platform/quickOpen/common/quickOpen'; import { TPromise } from 'vs/base/common/winjs.base'; @@ -306,4 +306,22 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { collector.addRule(`.quick-input-action:hover { background-color: ${buttonHoverBackgroundColor}; }`); collector.addRule(`.quick-input-action:focus { background-color: ${buttonHoverBackgroundColor}; }`); } + + // Overwrite inactive focus and selection colors with active ones. + const listInactiveFocusBackgroundColor = theme.getColor(listFocusBackground); + if (listInactiveFocusBackgroundColor) { + collector.addRule(`.quick-input-widget .monaco-list .monaco-list-row.focused { background-color: ${listInactiveFocusBackgroundColor}; }`); + collector.addRule(`.quick-input-widget .monaco-list .monaco-list-row.focused:hover { background-color: ${listInactiveFocusBackgroundColor}; }`); // overwrite :hover style in this case! + } + + const listInactiveSelectionBackgroundColor = theme.getColor(listActiveSelectionBackground); + if (listInactiveSelectionBackgroundColor) { + collector.addRule(`.quick-input-widget .monaco-list .monaco-list-row.selected { background-color: ${listInactiveSelectionBackgroundColor}; }`); + collector.addRule(`.quick-input-widget .monaco-list .monaco-list-row.selected:hover { background-color: ${listInactiveSelectionBackgroundColor}; }`); // overwrite :hover style in this case! + } + + const listInactiveSelectionForegroundColor = theme.getColor(listActiveSelectionForeground); + if (listInactiveSelectionForegroundColor) { + collector.addRule(`.quick-input-widget .monaco-list .monaco-list-row.selected { color: ${listInactiveSelectionForegroundColor}; }`); + } }); -- GitLab