Skip to content

Commit

Permalink
Ensure inactive focus background is overridden (#49340)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed May 9, 2018
1 parent a5cde11 commit 9bc399d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/vs/workbench/browser/parts/quickinput/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.$;

Expand Down Expand Up @@ -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';
}
Expand Down Expand Up @@ -421,4 +415,13 @@ function compareEntries(elementA: CheckableElement, elementB: CheckableElement,
}

return compareAnything(elementA.item.label, elementB.item.label, lookFor);
}
}

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}; }`);
}
});

0 comments on commit 9bc399d

Please sign in to comment.