Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
83a0776c
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,发现更多精彩内容 >>
提交
83a0776c
编写于
3月 11, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use helper for getting parts that we know are registered
上级
ca6f648f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
18 deletion
+26
-18
src/vs/workbench/browser/workbench.ts
src/vs/workbench/browser/workbench.ts
+26
-18
未找到文件。
src/vs/workbench/browser/workbench.ts
浏览文件 @
83a0776c
...
...
@@ -347,7 +347,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
this
.
workbench
.
insertBefore
(
partContainer
,
this
.
workbench
.
lastChild
);
}
this
.
parts
.
ge
t
(
id
).
create
(
partContainer
,
options
);
this
.
getPar
t
(
id
).
create
(
partContainer
,
options
);
});
// Notification Handlers
...
...
@@ -678,8 +678,8 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
}
private
setSideBarPosition
(
position
:
Position
):
void
{
const
activityBar
=
this
.
parts
.
ge
t
(
Parts
.
ACTIVITYBAR_PART
);
const
sideBar
=
this
.
parts
.
ge
t
(
Parts
.
SIDEBAR_PART
);
const
activityBar
=
this
.
getPar
t
(
Parts
.
ACTIVITYBAR_PART
);
const
sideBar
=
this
.
getPar
t
(
Parts
.
SIDEBAR_PART
);
const
wasHidden
=
this
.
state
.
sideBar
.
hidden
;
if
(
this
.
state
.
sideBar
.
hidden
)
{
...
...
@@ -899,17 +899,17 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
getContainer
(
part
:
Parts
):
HTMLElement
|
null
{
switch
(
part
)
{
case
Parts
.
TITLEBAR_PART
:
return
this
.
parts
.
ge
t
(
Parts
.
TITLEBAR_PART
).
getContainer
();
return
this
.
getPar
t
(
Parts
.
TITLEBAR_PART
).
getContainer
();
case
Parts
.
ACTIVITYBAR_PART
:
return
this
.
parts
.
ge
t
(
Parts
.
ACTIVITYBAR_PART
).
getContainer
();
return
this
.
getPar
t
(
Parts
.
ACTIVITYBAR_PART
).
getContainer
();
case
Parts
.
SIDEBAR_PART
:
return
this
.
parts
.
ge
t
(
Parts
.
SIDEBAR_PART
).
getContainer
();
return
this
.
getPar
t
(
Parts
.
SIDEBAR_PART
).
getContainer
();
case
Parts
.
PANEL_PART
:
return
this
.
parts
.
ge
t
(
Parts
.
PANEL_PART
).
getContainer
();
return
this
.
getPar
t
(
Parts
.
PANEL_PART
).
getContainer
();
case
Parts
.
EDITOR_PART
:
return
this
.
parts
.
ge
t
(
Parts
.
EDITOR_PART
).
getContainer
();
return
this
.
getPar
t
(
Parts
.
EDITOR_PART
).
getContainer
();
case
Parts
.
STATUSBAR_PART
:
return
this
.
parts
.
ge
t
(
Parts
.
STATUSBAR_PART
).
getContainer
();
return
this
.
getPar
t
(
Parts
.
STATUSBAR_PART
).
getContainer
();
}
return
null
;
...
...
@@ -950,7 +950,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
let
offset
=
0
;
if
(
this
.
isVisible
(
Parts
.
TITLEBAR_PART
))
{
if
(
this
.
workbenchGrid
instanceof
Grid
)
{
offset
=
this
.
parts
.
ge
t
(
Parts
.
TITLEBAR_PART
).
maximumHeight
;
offset
=
this
.
getPar
t
(
Parts
.
TITLEBAR_PART
).
maximumHeight
;
}
else
{
offset
=
this
.
workbenchGrid
.
partLayoutInfo
.
titlebar
.
height
;
...
...
@@ -1077,12 +1077,12 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
}
private
createWorkbenchLayout
(
instantiationService
:
IInstantiationService
):
void
{
const
titleBar
=
this
.
parts
.
ge
t
(
Parts
.
TITLEBAR_PART
);
const
editorPart
=
this
.
parts
.
ge
t
(
Parts
.
EDITOR_PART
);
const
activityBar
=
this
.
parts
.
ge
t
(
Parts
.
ACTIVITYBAR_PART
);
const
panelPart
=
this
.
parts
.
ge
t
(
Parts
.
PANEL_PART
);
const
sideBar
=
this
.
parts
.
ge
t
(
Parts
.
SIDEBAR_PART
);
const
statusBar
=
this
.
parts
.
ge
t
(
Parts
.
STATUSBAR_PART
);
const
titleBar
=
this
.
getPar
t
(
Parts
.
TITLEBAR_PART
);
const
editorPart
=
this
.
getPar
t
(
Parts
.
EDITOR_PART
);
const
activityBar
=
this
.
getPar
t
(
Parts
.
ACTIVITYBAR_PART
);
const
panelPart
=
this
.
getPar
t
(
Parts
.
PANEL_PART
);
const
sideBar
=
this
.
getPar
t
(
Parts
.
SIDEBAR_PART
);
const
statusBar
=
this
.
getPar
t
(
Parts
.
STATUSBAR_PART
);
if
(
this
.
configurationService
.
getValue
(
'
workbench.useExperimentalGridLayout
'
))
{
...
...
@@ -1412,7 +1412,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
isPanelMaximized
():
boolean
{
if
(
this
.
workbenchGrid
instanceof
Grid
)
{
try
{
return
this
.
workbenchGrid
.
getViewSize2
(
this
.
panelPartView
).
height
===
this
.
parts
.
ge
t
(
Parts
.
PANEL_PART
).
maximumHeight
;
return
this
.
workbenchGrid
.
getViewSize2
(
this
.
panelPartView
).
height
===
this
.
getPar
t
(
Parts
.
PANEL_PART
).
maximumHeight
;
}
catch
(
e
)
{
return
false
;
}
...
...
@@ -1450,7 +1450,7 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
}
setPanelPosition
(
position
:
Position
):
void
{
const
panelPart
=
this
.
parts
.
ge
t
(
Parts
.
PANEL_PART
);
const
panelPart
=
this
.
getPar
t
(
Parts
.
PANEL_PART
);
const
wasHidden
=
this
.
state
.
panel
.
hidden
;
if
(
this
.
state
.
panel
.
hidden
)
{
...
...
@@ -1521,6 +1521,14 @@ export class Workbench extends Disposable implements IWorkbenchLayoutService {
}
}
private
getPart
(
key
:
Parts
):
Part
{
const
part
=
this
.
parts
.
get
(
key
);
if
(
!
part
)
{
throw
new
Error
(
'
unknown part
'
);
}
return
part
;
}
dispose
():
void
{
super
.
dispose
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录