mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from master
This commit is contained in:
@@ -3,10 +3,8 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IThemeService, ITheme, DARK } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, ITheme, DARK, IIconTheme } from 'vs/platform/theme/common/themeService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
export class TestTheme implements ITheme {
|
||||
@@ -14,12 +12,12 @@ export class TestTheme implements ITheme {
|
||||
constructor(private colors: { [id: string]: string; } = {}, public type = DARK) {
|
||||
}
|
||||
|
||||
getColor(color: string, useDefault?: boolean): Color {
|
||||
getColor(color: string, useDefault?: boolean): Color | null {
|
||||
let value = this.colors[color];
|
||||
if (value) {
|
||||
return Color.fromHex(value);
|
||||
}
|
||||
return void 0;
|
||||
return null;
|
||||
}
|
||||
|
||||
defines(color: string): boolean {
|
||||
@@ -27,14 +25,23 @@ export class TestTheme implements ITheme {
|
||||
}
|
||||
}
|
||||
|
||||
export class TestIconTheme implements IIconTheme {
|
||||
hasFileIcons = false;
|
||||
hasFolderIcons = false;
|
||||
hidesExplorerArrows = false;
|
||||
}
|
||||
|
||||
export class TestThemeService implements IThemeService {
|
||||
|
||||
_serviceBrand: any;
|
||||
_theme: ITheme;
|
||||
_iconTheme: IIconTheme;
|
||||
_onThemeChange = new Emitter<ITheme>();
|
||||
_onIconThemeChange = new Emitter<IIconTheme>();
|
||||
|
||||
constructor(theme = new TestTheme()) {
|
||||
constructor(theme = new TestTheme(), iconTheme = new TestIconTheme()) {
|
||||
this._theme = theme;
|
||||
this._iconTheme = iconTheme;
|
||||
}
|
||||
|
||||
getTheme(): ITheme {
|
||||
@@ -53,4 +60,12 @@ export class TestThemeService implements IThemeService {
|
||||
public get onThemeChange(): Event<ITheme> {
|
||||
return this._onThemeChange.event;
|
||||
}
|
||||
|
||||
getIconTheme(): IIconTheme {
|
||||
return this._iconTheme;
|
||||
}
|
||||
|
||||
public get onIconThemeChange(): Event<IIconTheme> {
|
||||
return this._onIconThemeChange.event;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user