Skip to content

Commit 9bc399d

Browse files
committed
Ensure inactive focus background is overridden (#49340)
1 parent a5cde11 commit 9bc399d

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/vs/workbench/browser/parts/quickinput/quickInput.ts

-1
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,6 @@ export class QuickInputService extends Component implements IQuickInputService {
646646
const theme = this.themeService.getTheme();
647647
if (this.ui) {
648648
this.ui.inputBox.style(theme);
649-
this.ui.checkboxList.style(theme);
650649
}
651650
if (this.container) {
652651
const sideBarBackground = theme.getColor(SIDE_BAR_BACKGROUND);

src/vs/workbench/browser/parts/quickinput/quickInputCheckboxList.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { memoize } from 'vs/base/common/decorators';
2525
import { range } from 'vs/base/common/arrays';
2626
import * as platform from 'vs/base/common/platform';
2727
import { listFocusBackground } from 'vs/platform/theme/common/colorRegistry';
28-
import { ITheme } from 'vs/platform/theme/common/themeService';
28+
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
2929

3030
const $ = dom.$;
3131

@@ -381,12 +381,6 @@ export class QuickInputCheckboxList {
381381
}
382382
}
383383

384-
style(theme: ITheme) {
385-
this.list.style({
386-
listInactiveFocusBackground: theme.getColor(listFocusBackground),
387-
});
388-
}
389-
390384
display(display: boolean) {
391385
this.container.style.display = display ? '' : 'none';
392386
}
@@ -421,4 +415,13 @@ function compareEntries(elementA: CheckableElement, elementB: CheckableElement,
421415
}
422416

423417
return compareAnything(elementA.item.label, elementB.item.label, lookFor);
424-
}
418+
}
419+
420+
registerThemingParticipant((theme, collector) => {
421+
// Override inactive focus background with active focus background for single-pick case.
422+
const listInactiveFocusBackground = theme.getColor(listFocusBackground);
423+
if (listInactiveFocusBackground) {
424+
collector.addRule(`.quick-input-checkbox-list .monaco-list .monaco-list-row.focused { background-color: ${listInactiveFocusBackground}; }`);
425+
collector.addRule(`.quick-input-checkbox-list .monaco-list .monaco-list-row.focused:hover { background-color: ${listInactiveFocusBackground}; }`);
426+
}
427+
});

0 commit comments

Comments
 (0)