Skip to content

Commit

Permalink
Add quick open/input color registrations (fixes #65153)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseadamsio authored and chrmarti committed Jun 24, 2019
1 parent 6a7020d commit 9e02832
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/vs/workbench/browser/parts/quickinput/quickInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import * as dom from 'vs/base/browser/dom';
import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { contrastBorder, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
import { QUICK_OPEN_BACKGROUND, QUICK_OPEN_FOREGROUND } from 'vs/workbench/common/theme';
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
import { CancellationToken } from 'vs/base/common/cancellation';
import { QuickInputList } from './quickInputList';
Expand Down Expand Up @@ -1512,10 +1512,10 @@ export class QuickInputService extends Component implements IQuickInputService {
const titleColor = { dark: 'rgba(255, 255, 255, 0.105)', light: 'rgba(0,0,0,.06)', hc: 'black' }[theme.type];
this.titleBar.style.backgroundColor = titleColor ? titleColor.toString() : null;
this.ui.inputBox.style(theme);
const sideBarBackground = theme.getColor(SIDE_BAR_BACKGROUND);
this.ui.container.style.backgroundColor = sideBarBackground ? sideBarBackground.toString() : null;
const sideBarForeground = theme.getColor(SIDE_BAR_FOREGROUND);
this.ui.container.style.color = sideBarForeground ? sideBarForeground.toString() : null;
const quickOpenBackground = theme.getColor(QUICK_OPEN_BACKGROUND);
this.ui.container.style.backgroundColor = quickOpenBackground ? quickOpenBackground.toString() : null;
const quickOpenForeground = theme.getColor(QUICK_OPEN_FOREGROUND);
this.ui.container.style.color = quickOpenForeground ? quickOpenForeground.toString() : null;
const contrastBorderColor = theme.getColor(contrastBorder);
this.ui.container.style.border = contrastBorderColor ? `1px solid ${contrastBorderColor}` : null;
const widgetShadowColor = theme.getColor(widgetShadow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { IInstantiationService, ServiceIdentifier } from 'vs/platform/instantiat
import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { SIDE_BAR_BACKGROUND, SIDE_BAR_FOREGROUND } from 'vs/workbench/common/theme';
import { QUICK_OPEN_BACKGROUND, QUICK_OPEN_FOREGROUND } from 'vs/workbench/common/theme';
import { attachQuickOpenStyler } from 'vs/platform/theme/common/styler';
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { IFileService } from 'vs/platform/files/common/files';
Expand Down Expand Up @@ -188,7 +188,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
treeCreator: (container, config, opts) => this.instantiationService.createInstance(WorkbenchTree, container, config, opts)
}
));
this._register(attachQuickOpenStyler(this.quickOpenWidget, this.themeService, { background: SIDE_BAR_BACKGROUND, foreground: SIDE_BAR_FOREGROUND }));
this._register(attachQuickOpenStyler(this.quickOpenWidget, this.themeService, { background: QUICK_OPEN_BACKGROUND, foreground: QUICK_OPEN_FOREGROUND }));

const quickOpenContainer = this.quickOpenWidget.create();
addClass(quickOpenContainer, 'show-file-icons');
Expand Down
14 changes: 14 additions & 0 deletions src/vs/workbench/common/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,20 @@ export const SIDE_BAR_SECTION_HEADER_BORDER = registerColor('sideBarSectionHeade
}, nls.localize('sideBarSectionHeaderBorder', "Side bar section header border color. The side bar is the container for views like explorer and search."));


// < --- Quick Input -- >

export const QUICK_OPEN_BACKGROUND = registerColor('quickOpen.background', {
dark: SIDE_BAR_BACKGROUND,
light: SIDE_BAR_BACKGROUND,
hc: SIDE_BAR_BACKGROUND
}, nls.localize('quickOpenBackground', "Quick open background color. The quick open palette is the container for views like the command palette and file quick picker"));

export const QUICK_OPEN_FOREGROUND = registerColor('quickOpen.foreground', {
dark: SIDE_BAR_FOREGROUND,
light: SIDE_BAR_FOREGROUND,
hc: SIDE_BAR_FOREGROUND
}, nls.localize('quickOpenForeground', "Quick open foreground color. The quick open palette is the container for views like the command palette and file quick picker"));

// < --- Title Bar --- >

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

0 comments on commit 9e02832

Please sign in to comment.