Skip to content

Commit f690f66

Browse files
committed
1 parent 927c007 commit f690f66

3 files changed

Lines changed: 37 additions & 6 deletions

File tree

src/vs/base/browser/ui/checkbox/checkbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ const defaultOpts = {
4141

4242
export class CheckboxActionViewItem extends BaseActionViewItem {
4343

44-
private checkbox: Checkbox | undefined;
45-
private readonly disposables = new DisposableStore();
44+
protected checkbox: Checkbox | undefined;
45+
protected readonly disposables = new DisposableStore();
4646

4747
render(container: HTMLElement): void {
4848
this.element = container;
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
import { IBaseActionViewItemOptions } from 'vs/base/browser/ui/actionbar/actionbar';
7+
import { CheckboxActionViewItem } from 'vs/base/browser/ui/checkbox/checkbox';
8+
import { IAction } from 'vs/base/common/actions';
9+
import { IThemeService } from 'vs/platform/theme/common/themeService';
10+
import { attachCheckboxStyler } from 'vs/platform/theme/common/styler';
11+
12+
export class ThemableCheckboxActionViewItem extends CheckboxActionViewItem {
13+
14+
constructor(context: any, action: IAction, options: IBaseActionViewItemOptions | undefined, private readonly themeService: IThemeService) {
15+
super(context, action, options);
16+
}
17+
18+
render(container: HTMLElement): void {
19+
super.render(container);
20+
if (this.checkbox) {
21+
this.disposables.add(attachCheckboxStyler(this.checkbox, this.themeService));
22+
}
23+
}
24+
25+
}
26+

src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { IListAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget';
4646
import { preferencesEditIcon } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets';
4747
import { Color, RGBA } from 'vs/base/common/color';
4848
import { WORKBENCH_BACKGROUND } from 'vs/workbench/common/theme';
49+
import { ThemableCheckboxActionViewItem } from 'vs/platform/browser/checkbox';
4950

5051
const $ = DOM.$;
5152

@@ -376,13 +377,17 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditorP
376377
const actionBar = this._register(new ActionBar(this.actionsContainer, {
377378
animated: false,
378379
actionViewItemProvider: (action: IAction) => {
380+
let checkboxViewItem: CheckboxActionViewItem | undefined;
379381
if (action.id === this.sortByPrecedenceAction.id) {
380-
return new CheckboxActionViewItem(null, action);
382+
checkboxViewItem = new ThemableCheckboxActionViewItem(null, action, undefined, this.themeService);
381383
}
382-
if (action.id === this.recordKeysAction.id) {
383-
return new CheckboxActionViewItem(null, action);
384+
else if (action.id === this.recordKeysAction.id) {
385+
checkboxViewItem = new ThemableCheckboxActionViewItem(null, action, undefined, this.themeService);
384386
}
385-
return undefined;
387+
if (checkboxViewItem) {
388+
389+
}
390+
return checkboxViewItem;
386391
}
387392
}));
388393

0 commit comments

Comments
 (0)