Skip to content

Commit 9e02832

Browse files
chaseadamsiochrmarti
authored andcommitted
Add quick open/input color registrations (fixes microsoft#65153)
1 parent 6a7020d commit 9e02832

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as dom from 'vs/base/browser/dom';
1111
import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
1212
import { IThemeService } from 'vs/platform/theme/common/themeService';
1313
import { contrastBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
14-
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
14+
import { QUICK_OPEN_BACKGROUND, QUICK_OPEN_FOREGROUND } from 'vs/workbench/common/theme';
1515
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
1616
import { CancellationToken } from 'vs/base/common/cancellation';
1717
import { QuickInputList } from './quickInputList';
@@ -1512,10 +1512,10 @@ export class QuickInputService extends Component implements IQuickInputService {
15121512
const titleColor = { dark: 'rgba(255, 255, 255, 0.105)', light: 'rgba(0,0,0,.06)', hc: 'black' }[theme.type];
15131513
this.titleBar.style.backgroundColor = titleColor ? titleColor.toString() : null;
15141514
this.ui.inputBox.style(theme);
1515-
const sideBarBackground = theme.getColor(SIDE_BAR_BACKGROUND);
1516-
this.ui.container.style.backgroundColor = sideBarBackground ? sideBarBackground.toString() : null;
1517-
const sideBarForeground = theme.getColor(SIDE_BAR_FOREGROUND);
1518-
this.ui.container.style.color = sideBarForeground ? sideBarForeground.toString() : null;
1515+
const quickOpenBackground = theme.getColor(QUICK_OPEN_BACKGROUND);
1516+
this.ui.container.style.backgroundColor = quickOpenBackground ? quickOpenBackground.toString() : null;
1517+
const quickOpenForeground = theme.getColor(QUICK_OPEN_FOREGROUND);
1518+
this.ui.container.style.color = quickOpenForeground ? quickOpenForeground.toString() : null;
15191519
const contrastBorderColor = theme.getColor(contrastBorder);
15201520
this.ui.container.style.border = contrastBorderColor ? `1px solid ${contrastBorderColor}` : null;
15211521
const widgetShadowColor = theme.getColor(widgetShadow);

src/vs/workbench/browser/parts/quickopen/quickOpenController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiat
3434
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
3535
import { IHistoryService } from 'vs/workbench/services/history/common/history';
3636
import { IThemeService } from 'vs/platform/theme/common/themeService';
37-
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
37+
import { QUICK_OPEN_BACKGROUND, QUICK_OPEN_FOREGROUND } from 'vs/workbench/common/theme';
3838
import { attachQuickOpenStyler } from 'vs/platform/theme/common/styler';
3939
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
4040
import { IFileService } from 'vs/platform/files/common/files';
@@ -188,7 +188,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
188188
treeCreator: (container, config, opts) => this.instantiationService.createInstance(WorkbenchTree, container, config, opts)
189189
}
190190
));
191-
this._register(attachQuickOpenStyler(this.quickOpenWidget, this.themeService, { background: SIDE_BAR_BACKGROUND, foreground: SIDE_BAR_FOREGROUND }));
191+
this._register(attachQuickOpenStyler(this.quickOpenWidget, this.themeService, { background: QUICK_OPEN_BACKGROUND, foreground: QUICK_OPEN_FOREGROUND }));
192192

193193
const quickOpenContainer = this.quickOpenWidget.create();
194194
addClass(quickOpenContainer, 'show-file-icons');

src/vs/workbench/common/theme.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,20 @@ export const SIDE_BAR_SECTION_HEADER_BORDER = registerColor('sideBarSectionHeade
437437
}, nls.localize('sideBarSectionHeaderBorder', "Side bar section header border color. The side bar is the container for views like explorer and search."));
438438

439439

440+
// < --- Quick Input -- >
441+
442+
export const QUICK_OPEN_BACKGROUND = registerColor('quickOpen.background', {
443+
dark: SIDE_BAR_BACKGROUND,
444+
light: SIDE_BAR_BACKGROUND,
445+
hc: SIDE_BAR_BACKGROUND
446+
}, nls.localize('quickOpenBackground', "Quick open background color. The quick open palette is the container for views like the command palette and file quick picker"));
447+
448+
export const QUICK_OPEN_FOREGROUND = registerColor('quickOpen.foreground', {
449+
dark: SIDE_BAR_FOREGROUND,
450+
light: SIDE_BAR_FOREGROUND,
451+
hc: SIDE_BAR_FOREGROUND
452+
}, nls.localize('quickOpenForeground', "Quick open foreground color. The quick open palette is the container for views like the command palette and file quick picker"));
453+
440454
// < --- Title Bar --- >
441455

442456
export const TITLE_BAR_ACTIVE_FOREGROUND = registerColor('titleBar.activeForeground', {

0 commit comments

Comments
 (0)