From 9bc399dd3ee68b3cfbe47faed39fca829f952715 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Wed, 9 May 2018 09:23:14 +0200 Subject: [PATCH] Ensure inactive focus background is overridden (#49340) --- .../browser/parts/quickinput/quickInput.ts | 1 - .../quickinput/quickInputCheckboxList.ts | 19 +++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index 3d77ec3f87b..f052e126c46 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -646,7 +646,6 @@ export class QuickInputService extends Component implements IQuickInputService { const theme = this.themeService.getTheme(); if (this.ui) { this.ui.inputBox.style(theme); - this.ui.checkboxList.style(theme); } if (this.container) { const sideBarBackground = theme.getColor(SIDE_BAR_BACKGROUND); diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputCheckboxList.ts b/src/vs/workbench/browser/parts/quickinput/quickInputCheckboxList.ts index f8a2f6774a6..6894dc69a21 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputCheckboxList.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputCheckboxList.ts @@ -25,7 +25,7 @@ import { memoize } from 'vs/base/common/decorators'; import { range } from 'vs/base/common/arrays'; import * as platform from 'vs/base/common/platform'; import { listFocusBackground } from 'vs/platform/theme/common/colorRegistry'; -import { ITheme } from 'vs/platform/theme/common/themeService'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; const $ = dom.$; @@ -381,12 +381,6 @@ export class QuickInputCheckboxList { } } - style(theme: ITheme) { - this.list.style({ - listInactiveFocusBackground: theme.getColor(listFocusBackground), - }); - } - display(display: boolean) { this.container.style.display = display ? '' : 'none'; } @@ -421,4 +415,13 @@ function compareEntries(elementA: CheckableElement, elementB: CheckableElement, } return compareAnything(elementA.item.label, elementB.item.label, lookFor); -} \ No newline at end of file +} + +registerThemingParticipant((theme, collector) => { + // Override inactive focus background with active focus background for single-pick case. + const listInactiveFocusBackground = theme.getColor(listFocusBackground); + if (listInactiveFocusBackground) { + collector.addRule(`.quick-input-checkbox-list .monaco-list .monaco-list-row.focused { background-color: ${listInactiveFocusBackground}; }`); + collector.addRule(`.quick-input-checkbox-list .monaco-list .monaco-list-row.focused:hover { background-color: ${listInactiveFocusBackground}; }`); + } +}); -- GitLab