Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
51f85b5c
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
51f85b5c
编写于
5月 12, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set default theme according to defaultThemeType
上级
2b9a1413
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
6 deletion
+18
-6
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
...orkbench/services/themes/browser/workbenchThemeService.ts
+2
-2
src/vs/workbench/services/themes/common/themeConfiguration.ts
...vs/workbench/services/themes/common/themeConfiguration.ts
+16
-4
未找到文件。
src/vs/workbench/services/themes/browser/workbenchThemeService.ts
浏览文件 @
51f85b5c
...
...
@@ -102,7 +102,8 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
@
ILogService
private
readonly
logService
:
ILogService
)
{
this
.
container
=
layoutService
.
container
;
this
.
settings
=
new
ThemeConfiguration
(
configurationService
);
const
defaultThemeType
=
environmentService
.
configuration
.
defaultThemeType
||
DARK
;
this
.
settings
=
new
ThemeConfiguration
(
configurationService
,
defaultThemeType
);
this
.
colorThemeRegistry
=
new
ThemeRegistry
(
extensionService
,
colorThemesExtPoint
,
ColorThemeData
.
fromExtensionTheme
);
this
.
colorThemeWatcher
=
new
ThemeFileWatcher
(
fileService
,
environmentService
,
this
.
reloadCurrentColorTheme
.
bind
(
this
));
...
...
@@ -127,7 +128,6 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
themeData
=
ColorThemeData
.
createUnloadedThemeForThemeType
(
HIGH_CONTRAST
);
}
if
(
!
themeData
)
{
const
defaultThemeType
=
environmentService
.
configuration
.
defaultThemeType
||
DARK
;
themeData
=
ColorThemeData
.
createUnloadedThemeForThemeType
(
defaultThemeType
);
}
themeData
.
setCustomizations
(
this
.
settings
);
...
...
src/vs/workbench/services/themes/common/themeConfiguration.ts
浏览文件 @
51f85b5c
...
...
@@ -14,7 +14,8 @@ import { workbenchColorsSchemaId } from 'vs/platform/theme/common/colorRegistry'
import
{
tokenStylingSchemaId
}
from
'
vs/platform/theme/common/tokenClassificationRegistry
'
;
import
{
ThemeSettings
,
IWorkbenchColorTheme
,
IWorkbenchFileIconTheme
,
IColorCustomizations
,
ITokenColorCustomizations
,
IWorkbenchProductIconTheme
,
ISemanticTokenColorCustomizations
,
IExperimentalSemanticTokenColorCustomizations
}
from
'
vs/workbench/services/themes/common/workbenchThemeService
'
;
import
{
IConfigurationService
,
ConfigurationTarget
}
from
'
vs/platform/configuration/common/configuration
'
;
const
DEFAULT_THEME_SETTING_VALUE
=
'
Default Dark+
'
;
import
{
ThemeType
,
HIGH_CONTRAST
,
LIGHT
}
from
'
vs/platform/theme/common/themeService
'
;
const
DEFAULT_THEME_DARK_SETTING_VALUE
=
'
Default Dark+
'
;
const
DEFAULT_THEME_LIGHT_SETTING_VALUE
=
'
Default Light+
'
;
const
DEFAULT_THEME_HC_SETTING_VALUE
=
'
Default High Contrast
'
;
...
...
@@ -32,7 +33,7 @@ const colorThemeSettingEnumDescriptions: string[] = [];
const
colorThemeSettingSchema
:
IConfigurationPropertySchema
=
{
type
:
'
string
'
,
description
:
nls
.
localize
(
'
colorTheme
'
,
"
Specifies the color theme used in the workbench.
"
),
default
:
DEFAULT_THEME_SETTING_VALUE
,
default
:
DEFAULT_THEME_
DARK_
SETTING_VALUE
,
enum
:
colorThemeSettingEnum
,
enumDescriptions
:
colorThemeSettingEnumDescriptions
,
errorMessage
:
nls
.
localize
(
'
colorThemeError
'
,
"
Theme is unknown or not installed.
"
),
...
...
@@ -109,7 +110,6 @@ const themeSettingsConfiguration: IConfigurationNode = {
[
ThemeSettings
.
PRODUCT_ICON_THEME
]:
productIconThemeSettingSchema
}
};
configurationRegistry
.
registerConfiguration
(
themeSettingsConfiguration
);
function
tokenGroupSettings
(
description
:
string
):
IJSONSchema
{
return
{
...
...
@@ -231,7 +231,19 @@ export function updateProductIconThemeConfigurationSchemas(themes: IWorkbenchPro
export
class
ThemeConfiguration
{
constructor
(
private
configurationService
:
IConfigurationService
)
{
constructor
(
private
configurationService
:
IConfigurationService
,
themeType
:
ThemeType
)
{
switch
(
themeType
)
{
case
LIGHT
:
colorThemeSettingSchema
.
default
=
DEFAULT_THEME_LIGHT_SETTING_VALUE
;
break
;
case
HIGH_CONTRAST
:
colorThemeSettingSchema
.
default
=
DEFAULT_THEME_HC_SETTING_VALUE
;
break
;
default
:
colorThemeSettingSchema
.
default
=
DEFAULT_THEME_DARK_SETTING_VALUE
;
break
;
}
configurationRegistry
.
registerConfiguration
(
themeSettingsConfiguration
);
}
public
get
colorTheme
():
string
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录