mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3
This commit is contained in:
@@ -5,13 +5,12 @@
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken, focusBorder, activeContrastBorder, editorWidgetForeground, editorErrorForeground, editorWarningForeground, editorInfoForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { IColorTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
// < --- Workbench (not customizable) --- >
|
||||
|
||||
export function WORKBENCH_BACKGROUND(theme: ITheme): Color {
|
||||
export function WORKBENCH_BACKGROUND(theme: IColorTheme): Color {
|
||||
switch (theme.type) {
|
||||
case 'dark':
|
||||
return Color.fromHex('#252526');
|
||||
@@ -461,20 +460,6 @@ 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_INPUT_BACKGROUND = registerColor('quickInput.background', {
|
||||
dark: SIDE_BAR_BACKGROUND,
|
||||
light: SIDE_BAR_BACKGROUND,
|
||||
hc: SIDE_BAR_BACKGROUND
|
||||
}, nls.localize('quickInputBackground', "Quick Input background color. The Quick Input widget is the container for views like the color theme picker."));
|
||||
|
||||
export const QUICK_INPUT_FOREGROUND = registerColor('quickInput.foreground', {
|
||||
dark: SIDE_BAR_FOREGROUND,
|
||||
light: SIDE_BAR_FOREGROUND,
|
||||
hc: SIDE_BAR_FOREGROUND
|
||||
}, nls.localize('quickInputForeground', "Quick Input foreground color. The Quick Input widget is the container for views like the color theme picker."));
|
||||
|
||||
// < --- Title Bar --- >
|
||||
|
||||
export const TITLE_BAR_ACTIVE_FOREGROUND = registerColor('titleBar.activeForeground', {
|
||||
@@ -606,41 +591,3 @@ export const WINDOW_INACTIVE_BORDER = registerColor('window.inactiveBorder', {
|
||||
light: null,
|
||||
hc: contrastBorder
|
||||
}, nls.localize('windowInactiveBorder', "The color used for the border of the window when it is inactive. Only supported in the desktop client when using the custom title bar."));
|
||||
|
||||
/**
|
||||
* Base class for all themable workbench components.
|
||||
*/
|
||||
export class Themable extends Disposable {
|
||||
protected theme: ITheme;
|
||||
|
||||
constructor(
|
||||
protected themeService: IThemeService
|
||||
) {
|
||||
super();
|
||||
|
||||
this.theme = themeService.getTheme();
|
||||
|
||||
// Hook up to theme changes
|
||||
this._register(this.themeService.onThemeChange(theme => this.onThemeChange(theme)));
|
||||
}
|
||||
|
||||
protected onThemeChange(theme: ITheme): void {
|
||||
this.theme = theme;
|
||||
|
||||
this.updateStyles();
|
||||
}
|
||||
|
||||
protected updateStyles(): void {
|
||||
// Subclasses to override
|
||||
}
|
||||
|
||||
protected getColor(id: string, modify?: (color: Color, theme: ITheme) => Color): string | null {
|
||||
let color = this.theme.getColor(id);
|
||||
|
||||
if (color && modify) {
|
||||
color = modify(color, this.theme);
|
||||
}
|
||||
|
||||
return color ? color.toString() : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user