Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
334bd170
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,发现更多精彩内容 >>
提交
334bd170
编写于
8月 17, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename theme to colortheme
上级
1449af5f
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
30 addition
and
30 deletion
+30
-30
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+1
-1
src/vs/workbench/browser/parts/editor/textEditor.ts
src/vs/workbench/browser/parts/editor/textEditor.ts
+2
-2
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+2
-2
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
...ench/parts/extensions/electron-browser/extensionEditor.ts
+2
-2
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
+2
-2
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
...orkbench/parts/terminal/electron-browser/terminalPanel.ts
+2
-2
src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts
...ench/parts/themes/electron-browser/themes.contribution.ts
+3
-3
src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts
.../themes/test/electron-browser/themes.test.contribution.ts
+4
-4
src/vs/workbench/services/themes/common/themeService.ts
src/vs/workbench/services/themes/common/themeService.ts
+4
-4
src/vs/workbench/services/themes/electron-browser/themeService.ts
...orkbench/services/themes/electron-browser/themeService.ts
+7
-7
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
334bd170
...
...
@@ -119,7 +119,7 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
this
.
sidebarWidth
=
this
.
storageService
.
getInteger
(
WorkbenchLayout
.
sashXWidthSettingsKey
,
StorageScope
.
GLOBAL
,
-
1
);
this
.
panelHeight
=
this
.
storageService
.
getInteger
(
WorkbenchLayout
.
sashYHeightSettingsKey
,
StorageScope
.
GLOBAL
,
0
);
this
.
toUnbind
.
push
(
themeService
.
onDidThemeChange
(
_
=>
this
.
relayout
()));
this
.
toUnbind
.
push
(
themeService
.
onDid
Color
ThemeChange
(
_
=>
this
.
relayout
()));
this
.
toUnbind
.
push
(
editorGroupService
.
onEditorsChanged
(()
=>
this
.
onEditorsChanged
()));
this
.
registerSashListeners
();
...
...
src/vs/workbench/browser/parts/editor/textEditor.ts
浏览文件 @
334bd170
...
...
@@ -55,7 +55,7 @@ export abstract class BaseTextEditor extends BaseEditor {
this
.
toUnbind
.
push
(
this
.
_eventService
.
addListener2
(
WorkbenchEventType
.
WORKBENCH_OPTIONS_CHANGED
,
_
=>
this
.
handleConfigurationChangeEvent
()));
this
.
toUnbind
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
e
=>
this
.
handleConfigurationChangeEvent
(
e
.
config
)));
this
.
toUnbind
.
push
(
_themeService
.
onDidThemeChange
(
_
=>
this
.
handleConfigurationChangeEvent
()));
this
.
toUnbind
.
push
(
_themeService
.
onDid
Color
ThemeChange
(
_
=>
this
.
handleConfigurationChangeEvent
()));
}
public
get
instantiationService
():
IInstantiationService
{
...
...
@@ -110,7 +110,7 @@ export abstract class BaseTextEditor extends BaseEditor {
overviewRulerLanes
:
3
,
glyphMargin
:
true
,
lineNumbersMinChars
:
3
,
theme
:
this
.
_themeService
.
getTheme
()
theme
:
this
.
_themeService
.
get
Color
Theme
()
};
// Always mixin editor options from the context into our set to allow for override
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
334bd170
...
...
@@ -197,7 +197,7 @@ export class WorkbenchShell {
windowSize
:
windowSize
,
emptyWorkbench
:
!
this
.
contextService
.
getWorkspace
(),
customKeybindingsCount
,
theme
:
this
.
themeService
.
getTheme
(),
theme
:
this
.
themeService
.
get
Color
Theme
(),
language
:
platform
.
language
});
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
334bd170
...
...
@@ -90,7 +90,7 @@ export class Repl extends Panel {
}
}
}));
this
.
toDispose
.
push
(
this
.
themeService
.
onDidThemeChange
(
e
=>
this
.
replInput
.
updateOptions
(
this
.
getReplInputOptions
())));
this
.
toDispose
.
push
(
this
.
themeService
.
onDid
Color
ThemeChange
(
e
=>
this
.
replInput
.
updateOptions
(
this
.
getReplInputOptions
())));
}
private
onReplElementsUpdated
():
void
{
...
...
@@ -227,7 +227,7 @@ export class Repl extends Panel {
lineDecorationsWidth
:
0
,
scrollBeyondLastLine
:
false
,
lineHeight
:
21
,
theme
:
this
.
themeService
.
getTheme
()
theme
:
this
.
themeService
.
get
Color
Theme
()
};
// Always mixin editor options from the context into our set to allow for override
...
...
src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts
浏览文件 @
334bd170
...
...
@@ -181,11 +181,11 @@ export class ExtensionEditor extends BaseEditor {
document
.
querySelector
(
'
.monaco-editor-background
'
)
);
webview
.
style
(
this
.
themeService
.
getTheme
());
webview
.
style
(
this
.
themeService
.
get
Color
Theme
());
webview
.
contents
=
[
renderBody
(
body
)];
const
linkListener
=
webview
.
onDidClickLink
(
link
=>
shell
.
openExternal
(
link
.
toString
()));
const
themeListener
=
this
.
themeService
.
onDidThemeChange
(
themeId
=>
webview
.
style
(
themeId
));
const
themeListener
=
this
.
themeService
.
onDid
Color
ThemeChange
(
themeId
=>
webview
.
style
(
themeId
));
this
.
transientDisposables
.
push
(
webview
,
linkListener
,
themeListener
);
})
.
then
(
null
,
()
=>
null
)
...
...
src/vs/workbench/parts/html/browser/htmlPreviewPart.ts
浏览文件 @
334bd170
...
...
@@ -110,8 +110,8 @@ export class HtmlPreviewPart extends BaseEditor {
this
.
_webviewDisposables
=
dispose
(
this
.
_webviewDisposables
);
this
.
_webview
=
undefined
;
}
else
{
this
.
_themeChangeSubscription
=
this
.
_themeService
.
onDidThemeChange
(
themeId
=>
this
.
webview
.
style
(
themeId
));
this
.
webview
.
style
(
this
.
_themeService
.
getTheme
());
this
.
_themeChangeSubscription
=
this
.
_themeService
.
onDid
Color
ThemeChange
(
themeId
=>
this
.
webview
.
style
(
themeId
));
this
.
webview
.
style
(
this
.
_themeService
.
get
Color
Theme
());
if
(
this
.
_hasValidModel
())
{
this
.
_modelChangeSubscription
=
this
.
_model
.
onDidChangeContent
(()
=>
this
.
webview
.
contents
=
this
.
_model
.
getLinesContent
());
...
...
src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts
浏览文件 @
334bd170
...
...
@@ -221,7 +221,7 @@ export class TerminalPanel extends Panel {
this
.
onTerminalInstanceExit
.
bind
(
this
));
this
.
terminalInstances
.
push
(
terminalInstance
);
this
.
setActiveTerminal
(
this
.
terminalInstances
.
length
-
1
);
this
.
toDispose
.
push
(
this
.
themeService
.
onDidThemeChange
(
this
.
updateTheme
.
bind
(
this
)));
this
.
toDispose
.
push
(
this
.
themeService
.
onDid
Color
ThemeChange
(
this
.
updateTheme
.
bind
(
this
)));
this
.
toDispose
.
push
(
this
.
configurationService
.
onDidUpdateConfiguration
(
this
.
updateConfig
.
bind
(
this
)));
this
.
updateTheme
();
this
.
updateConfig
();
...
...
@@ -253,7 +253,7 @@ export class TerminalPanel extends Panel {
private
updateTheme
(
themeId
?:
string
):
void
{
if
(
!
themeId
)
{
themeId
=
this
.
themeService
.
getTheme
();
themeId
=
this
.
themeService
.
get
Color
Theme
();
}
let
baseThemeId
=
getBaseThemeId
(
themeId
);
...
...
src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts
浏览文件 @
334bd170
...
...
@@ -38,8 +38,8 @@ class SelectThemeAction extends Action {
}
run
():
TPromise
<
void
>
{
return
this
.
themeService
.
getThemes
().
then
(
themes
=>
{
const
currentThemeId
=
this
.
themeService
.
getTheme
();
return
this
.
themeService
.
get
Color
Themes
().
then
(
themes
=>
{
const
currentThemeId
=
this
.
themeService
.
get
Color
Theme
();
const
currentTheme
=
themes
.
filter
(
theme
=>
theme
.
id
===
currentThemeId
)[
0
];
const
picks
:
IPickOpenEntry
[]
=
themes
...
...
@@ -47,7 +47,7 @@ class SelectThemeAction extends Action {
.
sort
((
t1
,
t2
)
=>
t1
.
label
.
localeCompare
(
t2
.
label
));
const
selectTheme
=
(
theme
,
broadcast
)
=>
{
this
.
themeService
.
setTheme
(
theme
.
id
,
broadcast
)
this
.
themeService
.
set
Color
Theme
(
theme
.
id
,
broadcast
)
.
done
(
null
,
err
=>
this
.
messageService
.
show
(
Severity
.
Info
,
localize
(
'
problemChangingTheme
'
,
"
Problem loading theme: {0}
"
,
err
.
message
)));
};
...
...
src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts
浏览文件 @
334bd170
...
...
@@ -82,7 +82,7 @@ class Snapper {
public
appendThemeInformation
(
data
:
Data
[])
:
TPromise
<
Data
[]
>
{
let
currentTheme
=
this
.
themeService
.
getTheme
();
let
currentTheme
=
this
.
themeService
.
get
Color
Theme
();
let
getThemeName
=
(
id
:
string
)
=>
{
let
part
=
'
vscode-theme-defaults-themes-
'
;
...
...
@@ -93,11 +93,11 @@ class Snapper {
return
void
0
;
};
return
this
.
themeService
.
getThemes
().
then
(
themeDatas
=>
{
return
this
.
themeService
.
get
Color
Themes
().
then
(
themeDatas
=>
{
let
defaultThemes
=
themeDatas
.
filter
(
themeData
=>
!!
getThemeName
(
themeData
.
id
));
return
TPromise
.
join
(
defaultThemes
.
map
(
defaultTheme
=>
{
let
themeId
=
defaultTheme
.
id
;
return
this
.
themeService
.
setTheme
(
themeId
,
false
).
then
(
success
=>
{
return
this
.
themeService
.
set
Color
Theme
(
themeId
,
false
).
then
(
success
=>
{
if
(
success
)
{
let
testNode
=
this
.
getTestNode
(
themeId
);
let
themeName
=
getThemeName
(
themeId
);
...
...
@@ -108,7 +108,7 @@ class Snapper {
});
}));
}).
then
(
_
=>
{
return
this
.
themeService
.
setTheme
(
currentTheme
,
false
).
then
(
_
=>
{
return
this
.
themeService
.
set
Color
Theme
(
currentTheme
,
false
).
then
(
_
=>
{
return
data
;
});
});
...
...
src/vs/workbench/services/themes/common/themeService.ts
浏览文件 @
334bd170
...
...
@@ -12,10 +12,10 @@ export let IThemeService = createDecorator<IThemeService>('themeService');
export
interface
IThemeService
{
_serviceBrand
:
any
;
setTheme
(
themeId
:
string
,
broadcastToAllWindows
:
boolean
):
TPromise
<
boolean
>
;
getTheme
():
string
;
getThemes
():
TPromise
<
IThemeData
[]
>
;
onDidThemeChange
:
Event
<
string
>
;
set
Color
Theme
(
themeId
:
string
,
broadcastToAllWindows
:
boolean
):
TPromise
<
boolean
>
;
get
Color
Theme
():
string
;
get
Color
Themes
():
TPromise
<
IThemeData
[]
>
;
onDid
Color
ThemeChange
:
Event
<
string
>
;
}
export
interface
IThemeData
{
...
...
src/vs/workbench/services/themes/electron-browser/themeService.ts
浏览文件 @
334bd170
...
...
@@ -122,12 +122,12 @@ export class ThemeService implements IThemeService {
windowService
.
onBroadcast
(
e
=>
{
if
(
e
.
channel
===
THEME_CHANNEL
&&
typeof
e
.
payload
===
'
string
'
)
{
this
.
setTheme
(
e
.
payload
,
false
);
this
.
set
Color
Theme
(
e
.
payload
,
false
);
}
});
}
public
get
onDidThemeChange
():
Event
<
string
>
{
public
get
onDid
Color
ThemeChange
():
Event
<
string
>
{
return
this
.
onThemeChange
.
event
;
}
...
...
@@ -139,10 +139,10 @@ export class ThemeService implements IThemeService {
themeId
=
DEFAULT_THEME_ID
;
this
.
storageService
.
store
(
THEME_PREF
,
themeId
,
StorageScope
.
GLOBAL
);
}
return
this
.
setTheme
(
themeId
,
false
);
return
this
.
set
Color
Theme
(
themeId
,
false
);
}
public
setTheme
(
themeId
:
string
,
broadcastToAllWindows
:
boolean
)
:
TPromise
<
boolean
>
{
public
set
Color
Theme
(
themeId
:
string
,
broadcastToAllWindows
:
boolean
)
:
TPromise
<
boolean
>
{
if
(
!
themeId
)
{
return
TPromise
.
as
(
false
);
}
...
...
@@ -177,12 +177,12 @@ export class ThemeService implements IThemeService {
return
this
.
applyThemeCSS
(
themeId
,
DEFAULT_THEME_ID
,
onApply
);
}
public
getTheme
()
{
public
get
Color
Theme
()
{
return
this
.
currentTheme
||
this
.
storageService
.
get
(
THEME_PREF
,
StorageScope
.
GLOBAL
,
DEFAULT_THEME_ID
);
}
private
loadTheme
(
themeId
:
string
,
defaultId
?:
string
):
TPromise
<
IInternalThemeData
>
{
return
this
.
getThemes
().
then
(
allThemes
=>
{
return
this
.
get
Color
Themes
().
then
(
allThemes
=>
{
let
themes
=
allThemes
.
filter
(
t
=>
t
.
id
===
themeId
);
if
(
themes
.
length
>
0
)
{
return
<
IInternalThemeData
>
themes
[
0
];
...
...
@@ -206,7 +206,7 @@ export class ThemeService implements IThemeService {
});
}
public
getThemes
():
TPromise
<
IThemeData
[]
>
{
public
get
Color
Themes
():
TPromise
<
IThemeData
[]
>
{
return
this
.
extensionService
.
onReady
().
then
(
isReady
=>
{
return
this
.
knownThemes
;
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录