Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9b945201
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,发现更多精彩内容 >>
提交
9b945201
编写于
4月 27, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
splitview: remove render from panel ctor
上级
3c053a51
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
10 deletion
+20
-10
src/vs/base/browser/ui/splitview/panelview.ts
src/vs/base/browser/ui/splitview/panelview.ts
+5
-3
src/vs/workbench/browser/parts/views/panelViewlet.ts
src/vs/workbench/browser/parts/views/panelViewlet.ts
+1
-1
src/vs/workbench/browser/parts/views/viewsViewlet.ts
src/vs/workbench/browser/parts/views/viewsViewlet.ts
+5
-4
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+9
-2
未找到文件。
src/vs/base/browser/ui/splitview/panelview.ts
浏览文件 @
9b945201
...
...
@@ -30,6 +30,9 @@ export interface IPanelStyles {
headerHighContrastBorder
?:
Color
;
}
/**
* Remember to call render after ctor
*/
export
abstract
class
Panel
implements
IView
{
private
static
readonly
HEADER_SIZE
=
22
;
...
...
@@ -40,7 +43,7 @@ export abstract class Panel implements IView {
private
_minimumBodySize
:
number
;
private
_maximumBodySize
:
number
;
private
ariaHeaderLabel
:
string
;
private
styles
:
IPanelStyles
|
undefined
=
undefined
;
private
styles
:
IPanelStyles
=
{}
;
readonly
element
:
HTMLElement
;
private
header
:
HTMLElement
;
...
...
@@ -107,7 +110,6 @@ export abstract class Panel implements IView {
this
.
_maximumBodySize
=
typeof
options
.
maximumBodySize
===
'
number
'
?
options
.
maximumBodySize
:
Number
.
POSITIVE_INFINITY
;
this
.
element
=
$
(
'
.panel
'
);
this
.
render
();
}
isExpanded
():
boolean
{
...
...
@@ -138,7 +140,7 @@ export abstract class Panel implements IView {
this
.
_onDidChange
.
fire
();
}
protected
render
():
void
{
render
():
void
{
this
.
header
=
$
(
'
.panel-header
'
);
append
(
this
.
element
,
this
.
header
);
this
.
header
.
setAttribute
(
'
tabindex
'
,
'
0
'
);
...
...
src/vs/workbench/browser/parts/views/panelViewlet.ts
浏览文件 @
9b945201
...
...
@@ -65,7 +65,7 @@ export abstract class ViewletPanel extends Panel {
this
.
actionRunner
=
options
.
actionRunner
;
}
protected
render
():
void
{
render
():
void
{
super
.
render
();
const
focusTracker
=
trackFocus
(
this
.
element
);
...
...
src/vs/workbench/browser/parts/views/viewsViewlet.ts
浏览文件 @
9b945201
...
...
@@ -382,7 +382,7 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
for
(
const
viewDescriptor
of
toAdd
)
{
let
viewState
=
this
.
viewsStates
.
get
(
viewDescriptor
.
id
);
let
index
=
visible
.
indexOf
(
viewDescriptor
);
const
view
=
this
.
createView
(
viewDescriptor
,
const
panel
=
this
.
createView
(
viewDescriptor
,
{
id
:
viewDescriptor
.
id
,
name
:
viewDescriptor
.
name
,
...
...
@@ -390,10 +390,11 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
expanded
:
!
(
viewState
?
viewState
.
collapsed
:
viewDescriptor
.
collapsed
),
viewletSettings
:
this
.
viewletSettings
});
toCreate
.
push
(
view
);
panel
.
render
();
toCreate
.
push
(
panel
);
const
size
=
(
viewState
&&
viewState
.
size
)
||
200
;
panelsToAdd
.
push
({
panel
:
view
,
size
,
index
});
panelsToAdd
.
push
({
panel
,
size
,
index
});
}
this
.
addPanels
(
panelsToAdd
);
...
...
@@ -586,7 +587,7 @@ export class ViewsViewlet extends PanelViewlet implements IViewsViewlet {
}
protected
createView
(
viewDescriptor
:
IViewDescriptor
,
options
:
IViewletViewOptions
):
ViewsViewletPanel
{
return
this
.
instantiationService
.
createInstance
(
viewDescriptor
.
ctor
,
options
);
return
this
.
instantiationService
.
createInstance
(
viewDescriptor
.
ctor
,
options
)
as
ViewsViewletPanel
;
}
protected
get
views
():
ViewsViewletPanel
[]
{
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
9b945201
...
...
@@ -768,7 +768,7 @@ export class RepositoryPanel extends ViewletPanel {
this
.
menus
=
instantiationService
.
createInstance
(
SCMMenus
,
repository
.
provider
);
}
protected
render
():
void
{
render
():
void
{
super
.
render
();
this
.
menus
.
onDidChangeTitle
(
this
.
updateActions
,
this
,
this
.
disposables
);
}
...
...
@@ -1168,6 +1168,7 @@ export class SCMViewlet extends PanelViewlet implements IViewModel, IViewsViewle
if
(
shouldMainPanelBeVisible
)
{
this
.
mainPanel
=
this
.
instantiationService
.
createInstance
(
MainPanel
,
this
);
this
.
mainPanel
.
render
();
this
.
addPanels
([{
panel
:
this
.
mainPanel
,
size
:
this
.
mainPanel
.
minimumSize
,
index
:
0
}]);
const
selectionChangeDisposable
=
this
.
mainPanel
.
onSelectionChange
(
this
.
onSelectionChange
,
this
);
...
...
@@ -1302,7 +1303,11 @@ export class SCMViewlet extends PanelViewlet implements IViewModel, IViewsViewle
// Collect new selected panels
const
newRepositoryPanels
=
repositories
.
filter
(
r
=>
this
.
repositoryPanels
.
every
(
p
=>
p
.
repository
!==
r
))
.
map
(
r
=>
this
.
instantiationService
.
createInstance
(
RepositoryPanel
,
r
,
this
));
.
map
(
r
=>
{
const
panel
=
this
.
instantiationService
.
createInstance
(
RepositoryPanel
,
r
,
this
);
panel
.
render
();
return
panel
;
});
// Add new selected panels
let
index
=
repositoryPanels
.
length
+
(
this
.
mainPanel
?
1
:
0
);
...
...
@@ -1364,6 +1369,8 @@ export class SCMViewlet extends PanelViewlet implements IViewModel, IViewsViewle
viewletSettings
:
{}
// what is this
})
as
ViewsViewletPanel
;
panel
.
render
();
this
.
addPanels
([{
panel
,
size
:
size
||
panel
.
minimumSize
,
index
:
start
+
index
}]);
panel
.
setVisible
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录