Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ffa0993c
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,发现更多精彩内容 >>
提交
ffa0993c
编写于
9月 11, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #56245
上级
e6d95f46
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
37 addition
and
31 deletion
+37
-31
src/vs/base/browser/browser.ts
src/vs/base/browser/browser.ts
+2
-4
src/vs/code/electron-browser/workbench/workbench.js
src/vs/code/electron-browser/workbench/workbench.js
+11
-12
src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts
...parts/splash/electron-browser/partsSplash.contribution.ts
+24
-15
未找到文件。
src/vs/base/browser/browser.ts
浏览文件 @
ffa0993c
...
...
@@ -125,9 +125,7 @@ export function setFullscreen(fullscreen: boolean): void {
export
function
isFullscreen
():
boolean
{
return
WindowManager
.
INSTANCE
.
isFullscreen
();
}
export
function
onDidChangeFullscreen
(
callback
:
()
=>
void
):
IDisposable
{
return
WindowManager
.
INSTANCE
.
onDidChangeFullscreen
(
callback
);
}
export
const
onDidChangeFullscreen
=
WindowManager
.
INSTANCE
.
onDidChangeFullscreen
;
export
function
setAccessibilitySupport
(
accessibilitySupport
:
Platform
.
AccessibilitySupport
):
void
{
WindowManager
.
INSTANCE
.
setAccessibilitySupport
(
accessibilitySupport
);
...
...
@@ -168,4 +166,4 @@ export function hasClipboardSupport() {
}
return
true
;
}
\ No newline at end of file
}
src/vs/code/electron-browser/workbench/workbench.js
浏览文件 @
ffa0993c
...
...
@@ -71,19 +71,21 @@ function showPartsSplash(configuration) {
data
=
void
0
;
}
// minimal color configuration (works with or without persisted data)
const
baseTheme
=
data
?
data
.
baseTheme
:
configuration
.
highContrast
?
'
hc-black
'
:
'
vs-dark
'
;
const
shellBackground
=
data
?
data
.
colorInfo
.
editorBackground
:
configuration
.
highContrast
?
'
#000000
'
:
'
#1E1E1E
'
;
const
shellForeground
=
data
?
data
.
colorInfo
.
foreground
:
configuration
.
highContrast
?
'
#FFFFFF
'
:
'
#CCCCCC
'
;
const
style
=
document
.
createElement
(
'
style
'
);
document
.
head
.
appendChild
(
style
);
document
.
body
.
className
=
`monaco-shell
${
baseTheme
}
`
;
style
.
innerHTML
=
`.monaco-shell { background-color:
${
shellBackground
}
; color:
${
shellForeground
}
; }`
;
if
(
data
)
{
const
{
layoutInfo
,
colorInfo
,
baseTheme
}
=
data
;
// set the theme base id used by images and some styles
document
.
body
.
className
=
`monaco-shell
${
baseTheme
}
`
;
// stylesheet that defines foreground and background color
style
.
innerHTML
=
`.monaco-shell { background-color:
${
colorInfo
.
editorBackground
}
; color:
${
colorInfo
.
foreground
}
; }`
;
if
(
data
&&
data
.
layoutInfo
)
{
// restore parts if possible (we might not always store layout info)
const
{
id
,
layoutInfo
,
colorInfo
}
=
data
;
const
splash
=
document
.
createElement
(
'
div
'
);
splash
.
id
=
data
.
id
;
splash
.
id
=
id
;
// ensure there is enough space
layoutInfo
.
sideBarWidth
=
Math
.
min
(
layoutInfo
.
sideBarWidth
,
window
.
innerWidth
-
(
layoutInfo
.
activityBarWidth
+
layoutInfo
.
editorPartMinWidth
));
...
...
@@ -105,9 +107,6 @@ function showPartsSplash(configuration) {
`
;
}
document
.
body
.
appendChild
(
splash
);
}
else
{
document
.
body
.
className
=
`monaco-shell
${
configuration
.
highContrast
?
'
hc-black
'
:
'
vs-dark
'
}
`
;
style
.
innerHTML
=
`.monaco-shell { background-color:
${
configuration
.
highContrast
?
'
#000000
'
:
'
#1E1E1E
'
}
; color:
${
configuration
.
highContrast
?
'
#FFFFFF
'
:
'
#CCCCCC
'
}
; }`
;
}
perf
.
mark
(
'
didShowPartsSplash
'
);
...
...
@@ -134,4 +133,4 @@ function getLazyEnv() {
ipc
.
send
(
'
vscode:fetchShellEnv
'
);
});
}
\ No newline at end of file
}
src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts
浏览文件 @
ffa0993c
...
...
@@ -5,20 +5,21 @@
'
use strict
'
;
import
{
onDidChangeFullscreen
,
isFullscreen
}
from
'
vs/base/browser/browser
'
;
import
{
getTotalHeight
,
getTotalWidth
}
from
'
vs/base/browser/dom
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
anyEvent
,
debounceEvent
}
from
'
vs/base/common/event
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IBroadcastService
}
from
'
vs/platform/broadcast/electron-browser/broadcastService
'
;
import
{
ILifecycleService
,
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IThemeService
,
getThemeTypeSelector
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IBroadcastService
}
from
'
vs/platform/broadcast/electron-browser/broadcastService
'
;
import
{
ColorIdentifier
,
editorBackground
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
getThemeTypeSelector
,
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
DEFAULT_EDITOR_MIN_DIMENSIONS
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
Extensions
,
IWorkbenchContributionsRegistry
}
from
'
vs/workbench/common/contributions
'
;
import
*
as
themes
from
'
vs/workbench/common/theme
'
;
import
{
IPartService
,
Parts
,
Position
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
debounceEvent
}
from
'
vs/base/common/event
'
;
import
{
DEFAULT_EDITOR_MIN_DIMENSIONS
}
from
'
vs/workbench/browser/parts/editor/editor
'
;
import
{
ColorIdentifier
,
editorBackground
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
class
PartsSplash
{
...
...
@@ -26,8 +27,8 @@ class PartsSplash {
private
readonly
_disposables
:
IDisposable
[]
=
[];
private
lastBaseTheme
:
string
;
private
lastBackground
:
string
;
private
_
lastBaseTheme
:
string
;
private
_
lastBackground
:
string
;
constructor
(
@
IThemeService
private
readonly
_themeService
:
IThemeService
,
...
...
@@ -37,7 +38,10 @@ class PartsSplash {
@
IBroadcastService
private
broadcastService
:
IBroadcastService
)
{
lifecycleService
.
when
(
LifecyclePhase
.
Running
).
then
(
_
=>
this
.
_removePartsSplash
());
debounceEvent
(
_partService
.
onEditorLayout
,
()
=>
{
},
50
)(
this
.
_savePartsSplash
,
this
,
this
.
_disposables
);
debounceEvent
(
anyEvent
<
any
>
(
onDidChangeFullscreen
,
_partService
.
onEditorLayout
),
()
=>
{
},
150
)(
this
.
_savePartsSplash
,
this
,
this
.
_disposables
);
}
dispose
():
void
{
...
...
@@ -55,7 +59,7 @@ class PartsSplash {
statusBarBackground
:
this
.
_getThemeColor
(
themes
.
STATUS_BAR_BACKGROUND
),
statusBarNoFolderBackground
:
this
.
_getThemeColor
(
themes
.
STATUS_BAR_NO_FOLDER_BACKGROUND
),
};
const
layoutInfo
=
{
const
layoutInfo
=
isFullscreen
()
?
undefined
:
{
sideBarSide
:
this
.
_partService
.
getSideBarPosition
()
===
Position
.
RIGHT
?
'
right
'
:
'
left
'
,
editorPartMinWidth
:
DEFAULT_EDITOR_MIN_DIMENSIONS
.
width
,
titleBarHeight
:
getTotalHeight
(
this
.
_partService
.
getContainer
(
Parts
.
TITLEBAR_PART
)),
...
...
@@ -63,12 +67,17 @@ class PartsSplash {
sideBarWidth
:
getTotalWidth
(
this
.
_partService
.
getContainer
(
Parts
.
SIDEBAR_PART
)),
statusBarHeight
:
getTotalHeight
(
this
.
_partService
.
getContainer
(
Parts
.
STATUSBAR_PART
)),
};
this
.
_storageService
.
store
(
'
parts-splash-data
'
,
JSON
.
stringify
({
id
:
PartsSplash
.
_splashElementId
,
colorInfo
,
layoutInfo
,
baseTheme
}),
StorageScope
.
GLOBAL
);
this
.
_storageService
.
store
(
'
parts-splash-data
'
,
JSON
.
stringify
({
id
:
PartsSplash
.
_splashElementId
,
colorInfo
,
layoutInfo
,
baseTheme
}),
StorageScope
.
GLOBAL
);
if
(
baseTheme
!==
this
.
lastBaseTheme
||
colorInfo
.
editorBackground
!==
this
.
lastBackground
)
{
if
(
baseTheme
!==
this
.
_lastBaseTheme
||
colorInfo
.
editorBackground
!==
this
.
_
lastBackground
)
{
// notify the main window on background color changes: the main window sets the background color to new windows
this
.
lastBaseTheme
=
baseTheme
;
this
.
lastBackground
=
colorInfo
.
editorBackground
;
this
.
_
lastBaseTheme
=
baseTheme
;
this
.
_
lastBackground
=
colorInfo
.
editorBackground
;
// the color needs to be in hex
const
backgroundColor
=
this
.
_themeService
.
getTheme
().
getColor
(
editorBackground
)
||
themes
.
WORKBENCH_BACKGROUND
(
this
.
_themeService
.
getTheme
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录