Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
14681a4d
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,发现更多精彩内容 >>
提交
14681a4d
编写于
6月 20, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add `ToggleHighContrast` that toggles the use of the high contrast theme to the standalone editor
上级
ce15df0f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
2 deletion
+45
-2
src/vs/editor/editor.main.ts
src/vs/editor/editor.main.ts
+1
-0
src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts
...s/editor/standalone/browser/standaloneThemeServiceImpl.ts
+5
-2
src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts
...andalone/browser/toggleHighContrast/toggleHighContrast.ts
+38
-0
src/vs/editor/standalone/common/standaloneThemeService.ts
src/vs/editor/standalone/common/standaloneThemeService.ts
+1
-0
未找到文件。
src/vs/editor/editor.main.ts
浏览文件 @
14681a4d
...
...
@@ -11,6 +11,7 @@ import 'vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard';
import
'
vs/editor/standalone/browser/quickOpen/quickOutline
'
;
import
'
vs/editor/standalone/browser/quickOpen/gotoLine
'
;
import
'
vs/editor/standalone/browser/quickOpen/quickCommand
'
;
import
'
vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast
'
;
import
{
createMonacoBaseAPI
}
from
'
vs/editor/common/standalone/standaloneBase
'
;
import
{
createMonacoEditorAPI
}
from
'
vs/editor/standalone/browser/standaloneEditor
'
;
...
...
src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts
浏览文件 @
14681a4d
...
...
@@ -23,9 +23,10 @@ const colorRegistry = <IColorRegistry>Registry.as(Extensions.ColorContribution);
const
themingRegistry
=
Registry
.
as
<
IThemingRegistry
>
(
ThemingExtensions
.
ThemingContribution
);
class
StandaloneTheme
implements
IStandaloneTheme
{
id
:
string
;
public
readonly
id
:
string
;
public
readonly
themeName
:
string
;
private
rules
:
ITokenThemeRule
[];
base
:
string
;
public
readonly
base
:
string
;
private
colors
:
{
[
colorId
:
string
]:
Color
};
private
defaultColors
:
{
[
colorId
:
string
]:
Color
};
private
_tokenTheme
:
TokenTheme
;
...
...
@@ -33,8 +34,10 @@ class StandaloneTheme implements IStandaloneTheme {
constructor
(
base
:
string
,
name
:
string
,
colors
:
IColors
,
rules
:
ITokenThemeRule
[])
{
if
(
name
.
length
>
0
)
{
this
.
id
=
base
+
'
'
+
name
;
this
.
themeName
=
name
;
}
else
{
this
.
id
=
base
;
this
.
themeName
=
base
;
}
this
.
base
=
base
;
this
.
rules
=
rules
;
...
...
src/vs/editor/standalone/browser/toggleHighContrast/toggleHighContrast.ts
0 → 100644
浏览文件 @
14681a4d
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
ICommonCodeEditor
}
from
'
vs/editor/common/editorCommon
'
;
import
{
editorAction
,
EditorAction
,
ServicesAccessor
}
from
'
vs/editor/common/editorCommonExtensions
'
;
import
{
IStandaloneThemeService
}
from
'
vs/editor/standalone/common/standaloneThemeService
'
;
@
editorAction
class
ToggleHighContrast
extends
EditorAction
{
private
_originalThemeName
:
string
;
constructor
()
{
super
({
id
:
'
editor.action.toggleHighContrast
'
,
label
:
nls
.
localize
(
'
toggleHighContrast
'
,
"
Toggle High Contrast Theme
"
),
alias
:
'
Toggle High Contrast Theme
'
,
precondition
:
null
});
this
.
_originalThemeName
=
null
;
}
public
run
(
accessor
:
ServicesAccessor
,
editor
:
ICommonCodeEditor
):
void
{
const
standaloneThemeService
=
accessor
.
get
(
IStandaloneThemeService
);
if
(
this
.
_originalThemeName
)
{
// We must toggle back to the integrator's theme
standaloneThemeService
.
setTheme
(
this
.
_originalThemeName
);
this
.
_originalThemeName
=
null
;
}
else
{
this
.
_originalThemeName
=
standaloneThemeService
.
getTheme
().
themeName
;
standaloneThemeService
.
setTheme
(
'
hc-black
'
);
}
}
}
src/vs/editor/standalone/common/standaloneThemeService.ts
浏览文件 @
14681a4d
...
...
@@ -22,6 +22,7 @@ export interface IStandaloneThemeData {
export
interface
IStandaloneTheme
extends
ITheme
{
tokenTheme
:
TokenTheme
;
themeName
:
string
;
}
export
interface
IStandaloneThemeService
extends
IThemeService
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录