提交 41de158b 编写于 作者: B Benjamin Pasero

Add sideBarSectionHeader.foreground color key and... (fixes #27118)

上级 8e0f07fd
......@@ -107,6 +107,7 @@ export interface IHeaderViewOptions extends IHeaderViewStyles {
}
export interface IHeaderViewStyles {
headerForeground?: Color;
headerBackground?: Color;
headerHighContrastBorder?: Color;
}
......@@ -123,6 +124,7 @@ export abstract class HeaderView extends View {
protected header: HTMLElement;
protected body: HTMLElement;
private headerForeground: Color;
private headerBackground: Color;
private headerHighContrastBorder;
......@@ -132,11 +134,13 @@ export abstract class HeaderView extends View {
this._headerSize = types.isUndefined(opts.headerSize) ? 22 : opts.headerSize;
this._showHeader = this._headerSize > 0;
this.headerForeground = opts.headerForeground;
this.headerBackground = opts.headerBackground || headerDefaultOpts.headerBackground;
this.headerHighContrastBorder = opts.headerHighContrastBorder;
}
style(styles: IHeaderViewStyles): void {
this.headerForeground = styles.headerForeground;
this.headerBackground = styles.headerBackground;
this.headerHighContrastBorder = styles.headerHighContrastBorder;
......@@ -149,9 +153,11 @@ export abstract class HeaderView extends View {
protected applyStyles(): void {
if (this.header) {
const headerForegroundColor = this.headerForeground ? this.headerForeground.toString() : null;
const headerBackgroundColor = this.headerBackground ? this.headerBackground.toString() : null;
const headerHighContrastBorderColor = this.headerHighContrastBorder ? this.headerHighContrastBorder.toString() : null;
this.header.style.color = headerForegroundColor;
this.header.style.backgroundColor = headerBackgroundColor;
this.header.style.borderTop = headerHighContrastBorderColor ? `1px solid ${headerHighContrastBorderColor}` : null;
}
......
......@@ -8,7 +8,7 @@
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
import { inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, lighten, badgeBackground, badgeForeground, progressBarBackground } from 'vs/platform/theme/common/colorRegistry';
import { IDisposable } from 'vs/base/common/lifecycle';
import { SIDE_BAR_SECTION_HEADER_BACKGROUND } from 'vs/workbench/common/theme';
import { SIDE_BAR_SECTION_HEADER_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND } from 'vs/workbench/common/theme';
export type styleFn = (colors: { [name: string]: ColorIdentifier }) => void;
......@@ -224,6 +224,7 @@ export function attachListStyler(widget: IThemable, themeService: IThemeService,
export function attachHeaderViewStyler(widget: IThemable, themeService: IThemeService, options?: { noContrastBorder?: boolean }): IDisposable {
return doAttachStyler(themeService, {
headerForeground: SIDE_BAR_SECTION_HEADER_FOREGROUND,
headerBackground: SIDE_BAR_SECTION_HEADER_BACKGROUND,
headerHighContrastBorder: (options && options.noContrastBorder) ? null : contrastBorder
}, widget);
......
......@@ -240,6 +240,12 @@ export const SIDE_BAR_SECTION_HEADER_BACKGROUND = registerColor('sideBarSectionH
hc: null
}, nls.localize('sideBarSectionHeaderBackground', "Side bar section header background color. The side bar is the container for views like explorer and search."));
export const SIDE_BAR_SECTION_HEADER_FOREGROUND = registerColor('sideBarSectionHeader.foreground', {
dark: SIDE_BAR_FOREGROUND,
light: SIDE_BAR_FOREGROUND,
hc: SIDE_BAR_FOREGROUND
}, nls.localize('sideBarSectionHeaderForeground', "Side bar section header foreground color. The side bar is the container for views like explorer and search."));
// < --- Title Bar --- >
......
......@@ -207,11 +207,11 @@ export class ExplorerViewlet extends Viewlet {
const views = [];
const viewsState = JSON.parse(this.storageService.get(ExplorerViewlet.EXPLORER_VIEWS_STATE, this.contextService.hasWorkspace() ? StorageScope.WORKSPACE : StorageScope.GLOBAL, '{}'));
for (const viewDescrirptor of viewDescriptors) {
const view = this.instantiationService.createInstance(viewDescrirptor.ctor, viewDescrirptor.id, {
name: viewDescrirptor.name,
for (const viewDescriptor of viewDescriptors) {
const view = this.instantiationService.createInstance(viewDescriptor.ctor, viewDescriptor.id, {
name: viewDescriptor.name,
actionRunner: this.getActionRunner(),
collapsed: viewsState[viewDescrirptor.id] ? (<IViewState>viewsState[viewDescrirptor.id]).collapsed : true
collapsed: viewsState[viewDescriptor.id] ? (<IViewState>viewsState[viewDescriptor.id]).collapsed : true
});
views.push(view);
this.views.push(view);
......
......@@ -80,6 +80,9 @@ import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/node/processRunn
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
import { IThemeService } from 'vs/platform/theme/common/themeService';
let $ = Builder.$;
let tasksCategory = nls.localize('tasksCategory', "Tasks");
......@@ -1370,8 +1373,6 @@ let schema: IJSONSchema = {
import schemaVersion1 from './jsonSchema_v1';
import schemaVersion2 from './jsonSchema_v2';
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
import { IThemeService } from 'vs/platform/theme/common/themeService';
schema.definitions = {
...schemaVersion1.definitions,
...schemaVersion2.definitions,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册