提交 85183296 编写于 作者: M Martin Aeschlimann

[theme] rename to workbenchThemeService.ts, use IThemeService where possible

上级 e1d2e7b4
...@@ -22,7 +22,7 @@ import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding'; ...@@ -22,7 +22,7 @@ import { TokenMetadata } from 'vs/editor/common/model/tokensBinaryEncoding';
import { TokenizationRegistry, LanguageIdentifier, FontStyle, StandardTokenType } from 'vs/editor/common/modes'; import { TokenizationRegistry, LanguageIdentifier, FontStyle, StandardTokenType } from 'vs/editor/common/modes';
import { CharCode } from 'vs/base/common/charCode'; import { CharCode } from 'vs/base/common/charCode';
import { findMatchingThemeRule } from 'vs/editor/electron-browser/textMate/TMHelper'; import { findMatchingThemeRule } from 'vs/editor/electron-browser/textMate/TMHelper';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { Color } from 'vs/base/common/color'; import { Color } from 'vs/base/common/color';
import { IMessageService } from 'vs/platform/message/common/message'; import { IMessageService } from 'vs/platform/message/common/message';
import Severity from 'vs/base/common/severity'; import Severity from 'vs/base/common/severity';
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'use strict'; 'use strict';
import { IColorTheme, ITokenColorizationSetting } from 'vs/workbench/services/themes/common/themeService'; import { IColorTheme, ITokenColorizationSetting } from 'vs/workbench/services/themes/common/workbenchThemeService';
export function findMatchingThemeRule(theme: IColorTheme, scopes: string[]): ThemeRule { export function findMatchingThemeRule(theme: IColorTheme, scopes: string[]): ThemeRule {
for (let i = scopes.length - 1; i >= 0; i--) { for (let i = scopes.length - 1; i >= 0; i--) {
......
...@@ -16,7 +16,7 @@ import { ExtensionMessageCollector } from 'vs/platform/extensions/common/extensi ...@@ -16,7 +16,7 @@ import { ExtensionMessageCollector } from 'vs/platform/extensions/common/extensi
import { ITokenizationSupport, TokenizationRegistry, IState, LanguageId } from 'vs/editor/common/modes'; import { ITokenizationSupport, TokenizationRegistry, IState, LanguageId } from 'vs/editor/common/modes';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
import { INITIAL, StackElement, IGrammar, Registry, IEmbeddedLanguagesMap as IEmbeddedLanguagesMap2 } from 'vscode-textmate'; import { INITIAL, StackElement, IGrammar, Registry, IEmbeddedLanguagesMap as IEmbeddedLanguagesMap2 } from 'vscode-textmate';
import { IWorkbenchThemeService, ITokenColorizationRule } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService, ITokenColorizationRule } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; import { ITextMateService } from 'vs/editor/node/textMate/textMateService';
import { grammarsExtPoint, IEmbeddedLanguagesMap, ITMSyntaxExtensionPoint } from 'vs/editor/node/textMate/TMGrammars'; import { grammarsExtPoint, IEmbeddedLanguagesMap, ITMSyntaxExtensionPoint } from 'vs/editor/node/textMate/TMGrammars';
import { TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token'; import { TokenizationResult, TokenizationResult2 } from 'vs/editor/common/core/token';
......
...@@ -14,9 +14,11 @@ import Event, { Emitter } from 'vs/base/common/event'; ...@@ -14,9 +14,11 @@ import Event, { Emitter } from 'vs/base/common/event';
export let IThemeService = createDecorator<IThemeService>('themeService'); export let IThemeService = createDecorator<IThemeService>('themeService');
// base themes // base themes
export const DARK = 'dark';
export const LIGHT = 'light';
export const HIGH_CONTRAST = 'hc';
export type ThemeType = 'light' | 'dark' | 'hc'; export type ThemeType = 'light' | 'dark' | 'hc';
export interface ITheme { export interface ITheme {
readonly selector: string; readonly selector: string;
readonly type: ThemeType; readonly type: ThemeType;
......
...@@ -15,10 +15,10 @@ import { IPartService, Position, ILayoutOptions, Parts } from 'vs/workbench/serv ...@@ -15,10 +15,10 @@ import { IPartService, Position, ILayoutOptions, Parts } from 'vs/workbench/serv
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService';
import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { getZoomFactor } from 'vs/base/browser/browser'; import { getZoomFactor } from 'vs/base/browser/browser';
import { IThemeService } from "vs/platform/theme/common/themeService";
const MIN_SIDEBAR_PART_WIDTH = 170; const MIN_SIDEBAR_PART_WIDTH = 170;
const MIN_EDITOR_PART_HEIGHT = 70; const MIN_EDITOR_PART_HEIGHT = 70;
...@@ -94,7 +94,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal ...@@ -94,7 +94,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
@IEditorGroupService private editorGroupService: IEditorGroupService, @IEditorGroupService private editorGroupService: IEditorGroupService,
@IPartService private partService: IPartService, @IPartService private partService: IPartService,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
@IWorkbenchThemeService themeService: IWorkbenchThemeService @IThemeService themeService: IThemeService
) { ) {
this.parent = parent; this.parent = parent;
this.workbenchContainer = workbenchContainer; this.workbenchContainer = workbenchContainer;
...@@ -124,7 +124,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal ...@@ -124,7 +124,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this.layoutEditorGroupsVertically = (this.editorGroupService.getGroupOrientation() !== 'horizontal'); this.layoutEditorGroupsVertically = (this.editorGroupService.getGroupOrientation() !== 'horizontal');
this.toUnbind.push(themeService.onDidColorThemeChange(_ => this.layout())); this.toUnbind.push(themeService.onThemeChange(_ => this.layout()));
this.toUnbind.push(editorGroupService.onEditorsChanged(() => this.onEditorsChanged())); this.toUnbind.push(editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));
this.toUnbind.push(editorGroupService.onGroupOrientationChanged(e => this.onGroupOrientationChanged())); this.toUnbind.push(editorGroupService.onGroupOrientationChanged(e => this.onGroupOrientationChanged()));
......
...@@ -31,7 +31,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur ...@@ -31,7 +31,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
......
...@@ -21,7 +21,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage'; ...@@ -21,7 +21,7 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { Scope } from 'vs/workbench/common/memento'; import { Scope } from 'vs/workbench/common/memento';
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService'; import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
......
...@@ -18,7 +18,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; ...@@ -18,7 +18,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IStorageService } from 'vs/platform/storage/common/storage'; import { IStorageService } from 'vs/platform/storage/common/storage';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
......
...@@ -101,8 +101,8 @@ import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview'; ...@@ -101,8 +101,8 @@ import SCMPreview from 'vs/workbench/parts/scm/browser/scmPreview';
import { readdir } from 'vs/base/node/pfs'; import { readdir } from 'vs/base/node/pfs';
import { join } from 'path'; import { join } from 'path';
import 'vs/platform/opener/browser/opener.contribution'; import 'vs/platform/opener/browser/opener.contribution';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/themeService'; import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService';
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
import { WINDOW_FOREGROUND } from 'vs/workbench/common/theme'; import { WINDOW_FOREGROUND } from 'vs/workbench/common/theme';
......
...@@ -38,7 +38,7 @@ import { ITitleService } from 'vs/workbench/services/title/common/titleService'; ...@@ -38,7 +38,7 @@ import { ITitleService } from 'vs/workbench/services/title/common/titleService';
import { Registry } from 'vs/platform/platform'; import { Registry } from 'vs/platform/platform';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry';
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { IWorkbenchThemeService, VS_HC_THEME, VS_DARK_THEME } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService, VS_HC_THEME, VS_DARK_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService';
import * as browser from 'vs/base/browser/browser'; import * as browser from 'vs/base/browser/browser';
import { ReloadWindowAction, ToggleDevToolsAction, ShowStartupPerformance, OpenRecentAction, ToggleSharedProcessAction } from 'vs/workbench/electron-browser/actions'; import { ReloadWindowAction, ToggleDevToolsAction, ShowStartupPerformance, OpenRecentAction, ToggleSharedProcessAction } from 'vs/workbench/electron-browser/actions';
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
......
...@@ -37,7 +37,7 @@ import * as debug from 'vs/workbench/parts/debug/common/debug'; ...@@ -37,7 +37,7 @@ import * as debug from 'vs/workbench/parts/debug/common/debug';
import { ClearReplAction } from 'vs/workbench/parts/debug/browser/debugActions'; import { ClearReplAction } from 'vs/workbench/parts/debug/browser/debugActions';
import { ReplHistory } from 'vs/workbench/parts/debug/common/replHistory'; import { ReplHistory } from 'vs/workbench/parts/debug/common/replHistory';
import { Panel } from 'vs/workbench/browser/panel'; import { Panel } from 'vs/workbench/browser/panel';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
import { IListService } from 'vs/platform/list/browser/listService'; import { IListService } from 'vs/platform/list/browser/listService';
......
...@@ -25,7 +25,6 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; ...@@ -25,7 +25,6 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IExtensionGalleryService, IExtensionManifest, IKeyBinding } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionGalleryService, IExtensionManifest, IKeyBinding } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService';
import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput';
import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, IExtensionDependencies } from 'vs/workbench/parts/extensions/common/extensions'; import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, IExtensionDependencies } from 'vs/workbench/parts/extensions/common/extensions';
import { Renderer, DataSource, Controller } from 'vs/workbench/parts/extensions/browser/dependenciesViewer'; import { Renderer, DataSource, Controller } from 'vs/workbench/parts/extensions/browser/dependenciesViewer';
...@@ -46,6 +45,7 @@ import { Position } from 'vs/platform/editor/common/editor'; ...@@ -46,6 +45,7 @@ import { Position } from 'vs/platform/editor/common/editor';
import { IListService } from 'vs/platform/list/browser/listService'; import { IListService } from 'vs/platform/list/browser/listService';
import { OS } from 'vs/base/common/platform'; import { OS } from 'vs/base/common/platform';
import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService';
import { IThemeService } from "vs/platform/theme/common/themeService";
function renderBody(body: string): string { function renderBody(body: string): string {
const nonce = new Date().getTime() + '' + new Date().getMilliseconds(); const nonce = new Date().getTime() + '' + new Date().getMilliseconds();
...@@ -155,7 +155,7 @@ export class ExtensionEditor extends BaseEditor { ...@@ -155,7 +155,7 @@ export class ExtensionEditor extends BaseEditor {
@IInstantiationService private instantiationService: IInstantiationService, @IInstantiationService private instantiationService: IInstantiationService,
@IViewletService private viewletService: IViewletService, @IViewletService private viewletService: IViewletService,
@IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService, @IExtensionsWorkbenchService private extensionsWorkbenchService: IExtensionsWorkbenchService,
@IWorkbenchThemeService protected themeService: IWorkbenchThemeService, @IThemeService protected themeService: IThemeService,
@IKeybindingService private keybindingService: IKeybindingService, @IKeybindingService private keybindingService: IKeybindingService,
@IMessageService private messageService: IMessageService, @IMessageService private messageService: IMessageService,
@IOpenerService private openerService: IOpenerService, @IOpenerService private openerService: IOpenerService,
...@@ -322,7 +322,7 @@ export class ExtensionEditor extends BaseEditor { ...@@ -322,7 +322,7 @@ export class ExtensionEditor extends BaseEditor {
.then(renderBody) .then(renderBody)
.then<void>(body => { .then<void>(body => {
const webview = new WebView(this.content, this.partService.getContainer(Parts.EDITOR_PART)); const webview = new WebView(this.content, this.partService.getContainer(Parts.EDITOR_PART));
webview.style(this.themeService.getColorTheme()); webview.style(this.themeService.getTheme());
webview.contents = [body]; webview.contents = [body];
webview.onDidClickLink(link => { webview.onDidClickLink(link => {
...@@ -331,7 +331,7 @@ export class ExtensionEditor extends BaseEditor { ...@@ -331,7 +331,7 @@ export class ExtensionEditor extends BaseEditor {
this.openerService.open(link); this.openerService.open(link);
} }
}, null, this.contentDisposables); }, null, this.contentDisposables);
this.themeService.onDidColorThemeChange(theme => webview.style(theme), null, this.contentDisposables); this.themeService.onThemeChange(theme => webview.style(theme), null, this.contentDisposables);
this.contentDisposables.push(webview); this.contentDisposables.push(webview);
}) })
.then(null, () => { .then(null, () => {
......
...@@ -28,7 +28,7 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history'; ...@@ -28,7 +28,7 @@ import { IHistoryService } from 'vs/workbench/services/history/common/history';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { CancelAction } from 'vs/platform/message/common/message'; import { CancelAction } from 'vs/platform/message/common/message';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
......
...@@ -40,7 +40,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView ...@@ -40,7 +40,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
import { IMessageService, Severity } from 'vs/platform/message/common/message'; import { IMessageService, Severity } from 'vs/platform/message/common/message';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { ResourceContextKey } from 'vs/workbench/common/resourceContextKey'; import { ResourceContextKey } from 'vs/workbench/common/resourceContextKey';
import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { isLinux } from 'vs/base/common/platform'; import { isLinux } from 'vs/base/common/platform';
export class ExplorerView extends CollapsibleViewletView { export class ExplorerView extends CollapsibleViewletView {
......
...@@ -18,13 +18,14 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; ...@@ -18,13 +18,14 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel';
import { HtmlInput } from 'vs/workbench/parts/html/common/htmlInput'; import { HtmlInput } from 'vs/workbench/parts/html/common/htmlInput';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IThemeService } from "vs/platform/theme/common/themeService";
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; import { ITextModelResolverService, ITextEditorModel } from 'vs/editor/common/services/resolverService';
import { Parts, IPartService } from 'vs/workbench/services/part/common/partService'; import { Parts, IPartService } from 'vs/workbench/services/part/common/partService';
import Webview from './webview'; import Webview from './webview';
/** /**
* An implementation of editor for showing HTML content in an IFrame by leveraging the HTML input. * An implementation of editor for showing HTML content in an IFrame by leveraging the HTML input.
*/ */
...@@ -48,7 +49,7 @@ export class HtmlPreviewPart extends BaseEditor { ...@@ -48,7 +49,7 @@ export class HtmlPreviewPart extends BaseEditor {
constructor( constructor(
@ITelemetryService telemetryService: ITelemetryService, @ITelemetryService telemetryService: ITelemetryService,
@ITextModelResolverService textModelResolverService: ITextModelResolverService, @ITextModelResolverService textModelResolverService: ITextModelResolverService,
@IWorkbenchThemeService protected themeService: IWorkbenchThemeService, @IThemeService protected themeService: IThemeService,
@IOpenerService openerService: IOpenerService, @IOpenerService openerService: IOpenerService,
@IWorkspaceContextService contextService: IWorkspaceContextService, @IWorkspaceContextService contextService: IWorkspaceContextService,
@IPartService private partService: IPartService @IPartService private partService: IPartService
...@@ -116,8 +117,8 @@ export class HtmlPreviewPart extends BaseEditor { ...@@ -116,8 +117,8 @@ export class HtmlPreviewPart extends BaseEditor {
this._webviewDisposables = dispose(this._webviewDisposables); this._webviewDisposables = dispose(this._webviewDisposables);
this._webview = undefined; this._webview = undefined;
} else { } else {
this._themeChangeSubscription = this.themeService.onDidColorThemeChange(themeId => this.webview.style(themeId)); this._themeChangeSubscription = this.themeService.onThemeChange(themeId => this.webview.style(themeId));
this.webview.style(this.themeService.getColorTheme()); this.webview.style(this.themeService.getTheme());
if (this._hasValidModel()) { if (this._hasValidModel()) {
this._modelChangeSubscription = this.model.onDidChangeContent(() => this.webview.contents = this.model.getLinesContent()); this._modelChangeSubscription = this.model.onDidChangeContent(() => this.webview.contents = this.model.getLinesContent());
......
...@@ -13,8 +13,8 @@ import Event, { Emitter } from 'vs/base/common/event'; ...@@ -13,8 +13,8 @@ import Event, { Emitter } from 'vs/base/common/event';
import { addDisposableListener, addClass } from 'vs/base/browser/dom'; import { addDisposableListener, addClass } from 'vs/base/browser/dom';
import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { MenuRegistry } from 'vs/platform/actions/common/actions'; import { MenuRegistry } from 'vs/platform/actions/common/actions';
import { IColorTheme } from 'vs/workbench/services/themes/common/themeService';
import { editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry'; import { editorBackground, editorForeground } from 'vs/platform/theme/common/colorRegistry';
import { ITheme, LIGHT, DARK } from "vs/platform/theme/common/themeService";
declare interface WebviewElement extends HTMLElement { declare interface WebviewElement extends HTMLElement {
src: string; src: string;
...@@ -145,7 +145,7 @@ export default class Webview { ...@@ -145,7 +145,7 @@ export default class Webview {
this._send('message', data); this._send('message', data);
} }
style(theme: IColorTheme): void { style(theme: ITheme): void {
const { fontFamily, fontWeight, fontSize } = window.getComputedStyle(this._styleElement); // TODO@theme avoid styleElement const { fontFamily, fontWeight, fontSize } = window.getComputedStyle(this._styleElement); // TODO@theme avoid styleElement
let value = ` let value = `
...@@ -184,7 +184,7 @@ export default class Webview { ...@@ -184,7 +184,7 @@ export default class Webview {
let activeTheme: ApiThemeClassName; let activeTheme: ApiThemeClassName;
if (theme.isLightTheme()) { if (theme.type === LIGHT) {
value += ` value += `
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: rgba(100, 100, 100, 0.4); background-color: rgba(100, 100, 100, 0.4);
...@@ -198,7 +198,7 @@ export default class Webview { ...@@ -198,7 +198,7 @@ export default class Webview {
activeTheme = 'vscode-light'; activeTheme = 'vscode-light';
} else if (theme.isDarkTheme()) { } else if (theme.type === DARK) {
value += ` value += `
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: rgba(121, 121, 121, 0.4); background-color: rgba(121, 121, 121, 0.4);
......
...@@ -21,7 +21,7 @@ import { EditorInput, EditorOptions } from 'vs/workbench/common/editor'; ...@@ -21,7 +21,7 @@ import { EditorInput, EditorOptions } from 'vs/workbench/common/editor';
import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor'; import { TextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor';
import { OutputEditors, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/parts/output/common/output'; import { OutputEditors, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/parts/output/common/output';
import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOutputScrollLockAction } from 'vs/workbench/parts/output/browser/outputActions'; import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOutputScrollLockAction } from 'vs/workbench/parts/output/browser/outputActions';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService'; import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
......
...@@ -32,7 +32,7 @@ import { SearchWidget, SettingsTabsWidget } from 'vs/workbench/parts/preferences ...@@ -32,7 +32,7 @@ import { SearchWidget, SettingsTabsWidget } from 'vs/workbench/parts/preferences
import { ContextKeyExpr, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { ContextKeyExpr, IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { CommonEditorRegistry, Command } from 'vs/editor/common/editorCommonExtensions'; import { CommonEditorRegistry, Command } from 'vs/editor/common/editorCommonExtensions';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IModelService } from 'vs/editor/common/services/modelService'; import { IModelService } from 'vs/editor/common/services/modelService';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
import { IStorageService } from 'vs/platform/storage/common/storage'; import { IStorageService } from 'vs/platform/storage/common/storage';
......
...@@ -35,7 +35,7 @@ import { IAction, IActionItem, ActionRunner } from 'vs/base/common/actions'; ...@@ -35,7 +35,7 @@ import { IAction, IActionItem, ActionRunner } from 'vs/base/common/actions';
import { createActionItem } from 'vs/platform/actions/browser/menuItemActionItem'; import { createActionItem } from 'vs/platform/actions/browser/menuItemActionItem';
import { SCMMenus } from './scmMenus'; import { SCMMenus } from './scmMenus';
import { ActionBar, IActionItemProvider } from 'vs/base/browser/ui/actionbar/actionbar'; import { ActionBar, IActionItemProvider } from 'vs/base/browser/ui/actionbar/actionbar';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IThemeService, LIGHT } from "vs/platform/theme/common/themeService";
import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox';
import { IModelService } from 'vs/editor/common/services/modelService'; import { IModelService } from 'vs/editor/common/services/modelService';
import { comparePaths } from 'vs/base/common/comparers'; import { comparePaths } from 'vs/base/common/comparers';
...@@ -134,7 +134,7 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> { ...@@ -134,7 +134,7 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
private scmMenus: SCMMenus, private scmMenus: SCMMenus,
private actionItemProvider: IActionItemProvider, private actionItemProvider: IActionItemProvider,
private getSelectedResources: () => URI[], private getSelectedResources: () => URI[],
@IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IThemeService private themeService: IThemeService,
@IInstantiationService private instantiationService: IInstantiationService @IInstantiationService private instantiationService: IInstantiationService
) { } ) { }
...@@ -159,8 +159,8 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> { ...@@ -159,8 +159,8 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
template.actionBar.push(this.scmMenus.getResourceActions(resource)); template.actionBar.push(this.scmMenus.getResourceActions(resource));
toggleClass(template.name, 'strike-through', resource.decorations.strikeThrough); toggleClass(template.name, 'strike-through', resource.decorations.strikeThrough);
const theme = this.themeService.getColorTheme(); const theme = this.themeService.getTheme();
const icon = theme.isDarkTheme() ? resource.decorations.iconDark : resource.decorations.icon; const icon = theme.type === LIGHT ? resource.decorations.icon : resource.decorations.iconDark;
if (icon) { if (icon) {
template.decorationIcon.style.backgroundImage = `url('${icon}')`; template.decorationIcon.style.backgroundImage = `url('${icon}')`;
...@@ -209,7 +209,7 @@ export class SCMViewlet extends Viewlet { ...@@ -209,7 +209,7 @@ export class SCMViewlet extends Viewlet {
@IMessageService private messageService: IMessageService, @IMessageService private messageService: IMessageService,
@IListService private listService: IListService, @IListService private listService: IListService,
@IContextMenuService private contextMenuService: IContextMenuService, @IContextMenuService private contextMenuService: IContextMenuService,
@IWorkbenchThemeService protected themeService: IWorkbenchThemeService, @IThemeService protected themeService: IThemeService,
@IMenuService private menuService: IMenuService, @IMenuService private menuService: IMenuService,
@IModelService private modelService: IModelService @IModelService private modelService: IModelService
) { ) {
...@@ -284,7 +284,7 @@ export class SCMViewlet extends Viewlet { ...@@ -284,7 +284,7 @@ export class SCMViewlet extends Viewlet {
this.setActiveProvider(this.scmService.activeProvider); this.setActiveProvider(this.scmService.activeProvider);
this.scmService.onDidChangeProvider(this.setActiveProvider, this, this.disposables); this.scmService.onDidChangeProvider(this.setActiveProvider, this, this.disposables);
this.themeService.onDidColorThemeChange(this.update, this, this.disposables); this.themeService.onThemeChange(this.update, this, this.disposables);
return TPromise.as(null); return TPromise.as(null);
} }
......
...@@ -17,7 +17,7 @@ import { IRange } from 'vs/editor/common/editorCommon'; ...@@ -17,7 +17,7 @@ import { IRange } from 'vs/editor/common/editorCommon';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
import { getIconClasses } from 'vs/workbench/browser/labels'; import { getIconClasses } from 'vs/workbench/browser/labels';
import { IModelService } from 'vs/editor/common/services/modelService'; import { IModelService } from 'vs/editor/common/services/modelService';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; import { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen';
import { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel';
import { QuickOpenHandler, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen'; import { QuickOpenHandler, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen';
......
...@@ -15,7 +15,7 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message'; ...@@ -15,7 +15,7 @@ import { IMessageService, Severity } from 'vs/platform/message/common/message';
import { Registry } from 'vs/platform/platform'; import { Registry } from 'vs/platform/platform';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actionRegistry';
import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen'; import { IQuickOpenService, IPickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen';
import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions'; import { VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions';
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet';
......
...@@ -12,7 +12,7 @@ import { IModeService } from 'vs/editor/common/services/modeService'; ...@@ -12,7 +12,7 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import pfs = require('vs/base/node/pfs'); import pfs = require('vs/base/node/pfs');
import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService, IColorTheme } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import { toResource } from 'vs/workbench/common/editor'; import { toResource } from 'vs/workbench/common/editor';
import { ITextMateService } from 'vs/editor/node/textMate/textMateService'; import { ITextMateService } from 'vs/editor/node/textMate/textMateService';
......
...@@ -12,7 +12,7 @@ import { Builder } from 'vs/base/browser/builder'; ...@@ -12,7 +12,7 @@ import { Builder } from 'vs/base/browser/builder';
import { append, $ } from 'vs/base/browser/dom'; import { append, $ } from 'vs/base/browser/dom';
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
import { ReleaseNotesInput } from './releaseNotesInput'; import { ReleaseNotesInput } from './releaseNotesInput';
import { EditorOptions } from 'vs/workbench/common/editor'; import { EditorOptions } from 'vs/workbench/common/editor';
import WebView from 'vs/workbench/parts/html/browser/webview'; import WebView from 'vs/workbench/parts/html/browser/webview';
...@@ -44,7 +44,7 @@ export class ReleaseNotesEditor extends BaseEditor { ...@@ -44,7 +44,7 @@ export class ReleaseNotesEditor extends BaseEditor {
constructor( constructor(
@ITelemetryService telemetryService: ITelemetryService, @ITelemetryService telemetryService: ITelemetryService,
@IWorkbenchThemeService protected themeService: IWorkbenchThemeService, @IThemeService protected themeService: IThemeService,
@IOpenerService private openerService: IOpenerService, @IOpenerService private openerService: IOpenerService,
@IModeService private modeService: IModeService, @IModeService private modeService: IModeService,
@IPartService private partService: IPartService @IPartService private partService: IPartService
...@@ -88,11 +88,11 @@ export class ReleaseNotesEditor extends BaseEditor { ...@@ -88,11 +88,11 @@ export class ReleaseNotesEditor extends BaseEditor {
.then<void>(body => { .then<void>(body => {
this.webview = new WebView(this.content, this.partService.getContainer(Parts.EDITOR_PART)); this.webview = new WebView(this.content, this.partService.getContainer(Parts.EDITOR_PART));
this.webview.baseUrl = `https://code.visualstudio.com/raw/`; this.webview.baseUrl = `https://code.visualstudio.com/raw/`;
this.webview.style(this.themeService.getColorTheme()); this.webview.style(this.themeService.getTheme());
this.webview.contents = [body]; this.webview.contents = [body];
this.webview.onDidClickLink(link => this.openerService.open(link), null, this.contentDisposables); this.webview.onDidClickLink(link => this.openerService.open(link), null, this.contentDisposables);
this.themeService.onDidColorThemeChange(themeId => this.webview.style(themeId), null, this.contentDisposables); this.themeService.onThemeChange(themeId => this.webview.style(themeId), null, this.contentDisposables);
this.contentDisposables.push(this.webview); this.contentDisposables.push(this.webview);
this.contentDisposables.push(toDisposable(() => this.webview = null)); this.contentDisposables.push(toDisposable(() => this.webview = null));
}); });
......
...@@ -19,7 +19,7 @@ import { EditorOptions } from 'vs/workbench/common/editor'; ...@@ -19,7 +19,7 @@ import { EditorOptions } from 'vs/workbench/common/editor';
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
import { marked } from 'vs/base/common/marked/marked'; import { marked } from 'vs/base/common/marked/marked';
import { IModeService } from 'vs/editor/common/services/modeService'; import { IModeService } from 'vs/editor/common/services/modeService';
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
import Paths = require('vs/base/common/paths'); import Paths = require('vs/base/common/paths');
import Json = require('vs/base/common/json'); import Json = require('vs/base/common/json');
import { Color } from 'vs/base/common/color'; import { Color } from 'vs/base/common/color';
import { ExtensionData, ITokenColorizationRule, IColorTheme, IColorMap, VS_LIGHT_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/themeService'; import { ExtensionData, ITokenColorizationRule, IColorTheme, IColorMap, VS_LIGHT_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { convertSettings } from 'vs/workbench/services/themes/electron-browser/themeCompatibility'; import { convertSettings } from 'vs/workbench/services/themes/electron-browser/themeCompatibility';
import { TPromise } from 'vs/base/common/winjs.base'; import { TPromise } from 'vs/base/common/winjs.base';
import { getBaseThemeId, getSyntaxThemeId, isDarkTheme, isLightTheme } from 'vs/platform/theme/common/themes'; import { getBaseThemeId, getSyntaxThemeId, isDarkTheme, isLightTheme } from 'vs/platform/theme/common/themes';
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information. * Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import { ITokenColorizationRule, IColorMap } from 'vs/workbench/services/themes/common/themeService'; import { ITokenColorizationRule, IColorMap } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { Color } from 'vs/base/common/color'; import { Color } from 'vs/base/common/color';
import * as colorRegistry from 'vs/platform/theme/common/colorRegistry'; import * as colorRegistry from 'vs/platform/theme/common/colorRegistry';
......
...@@ -12,7 +12,7 @@ import * as types from 'vs/base/common/types'; ...@@ -12,7 +12,7 @@ import * as types from 'vs/base/common/types';
import { IThemeExtensionPoint } from 'vs/platform/theme/common/themeExtensionPoint'; import { IThemeExtensionPoint } from 'vs/platform/theme/common/themeExtensionPoint';
import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry'; import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry';
import { IWorkbenchThemeService, IColorTheme, IFileIconTheme, ExtensionData, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, COLOR_THEME_SETTING, ICON_THEME_SETTING } from 'vs/workbench/services/themes/common/themeService'; import { IWorkbenchThemeService, IColorTheme, IFileIconTheme, ExtensionData, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME, COLOR_THEME_SETTING, ICON_THEME_SETTING } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService'; import { IWindowIPCService } from 'vs/workbench/services/window/electron-browser/windowService';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册