Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
916287fd
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,发现更多精彩内容 >>
提交
916287fd
编写于
7月 26, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove EditorPart._preferredSize
related to #67367
上级
5cc02113
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
45 deletion
+0
-45
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+0
-34
src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts
.../services/editor/test/browser/editorGroupsService.test.ts
+0
-11
未找到文件。
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
916287fd
...
...
@@ -112,13 +112,8 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
private
_onDidSizeConstraintsChange
=
this
.
_register
(
new
Relay
<
{
width
:
number
;
height
:
number
;
}
|
undefined
>
());
get
onDidSizeConstraintsChange
():
Event
<
{
width
:
number
;
height
:
number
;
}
|
undefined
>
{
return
Event
.
any
(
this
.
onDidSetGridWidget
.
event
,
this
.
_onDidSizeConstraintsChange
.
event
);
}
private
readonly
_onDidPreferredSizeChange
:
Emitter
<
void
>
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidPreferredSizeChange
:
Event
<
void
>
=
this
.
_onDidPreferredSizeChange
.
event
;
//#endregion
private
_preferredSize
:
Dimension
|
undefined
;
private
readonly
workspaceMemento
:
MementoObject
;
private
readonly
globalMemento
:
MementoObject
;
...
...
@@ -366,9 +361,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
const
newOrientation
=
(
orientation
===
GroupOrientation
.
HORIZONTAL
)
?
Orientation
.
HORIZONTAL
:
Orientation
.
VERTICAL
;
if
(
this
.
gridWidget
.
orientation
!==
newOrientation
)
{
this
.
gridWidget
.
orientation
=
newOrientation
;
// Mark preferred size as changed
this
.
resetPreferredSize
();
}
}
...
...
@@ -423,9 +415,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
// Update container
this
.
updateContainer
();
// Mark preferred size as changed
this
.
resetPreferredSize
();
// Events for groups that got added
this
.
getGroups
(
GroupsOrder
.
GRID_APPEARANCE
).
forEach
(
groupView
=>
{
if
(
currentGroupViews
.
indexOf
(
groupView
)
===
-
1
)
{
...
...
@@ -490,9 +479,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
// Update container
this
.
updateContainer
();
// Mark preferred size as changed
this
.
resetPreferredSize
();
// Event
this
.
_onDidAddGroup
.
fire
(
newGroupView
);
...
...
@@ -661,9 +647,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
// Update container
this
.
updateContainer
();
// Mark preferred size as changed
this
.
resetPreferredSize
();
// Event
this
.
_onDidRemoveGroup
.
fire
(
groupView
);
}
...
...
@@ -764,23 +747,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
get
onDidChange
():
Event
<
IViewSize
|
undefined
>
{
return
this
.
centeredLayoutWidget
.
onDidChange
;
}
readonly
priority
:
LayoutPriority
=
LayoutPriority
.
High
;
get
preferredSize
():
Dimension
{
if
(
!
this
.
_preferredSize
)
{
this
.
_preferredSize
=
new
Dimension
(
this
.
gridWidget
.
minimumWidth
,
this
.
gridWidget
.
minimumHeight
);
}
return
this
.
_preferredSize
;
}
private
resetPreferredSize
():
void
{
// Reset (will be computed upon next access)
this
.
_preferredSize
=
undefined
;
// Event
this
.
_onDidPreferredSizeChange
.
fire
();
}
private
get
gridSeparatorBorder
():
Color
{
return
this
.
theme
.
getColor
(
EDITOR_GROUP_BORDER
)
||
this
.
theme
.
getColor
(
contrastBorder
)
||
Color
.
transparent
;
}
...
...
src/vs/workbench/services/editor/test/browser/editorGroupsService.test.ts
浏览文件 @
916287fd
...
...
@@ -118,11 +118,6 @@ suite('EditorGroupsService', () => {
groupMovedCounter
++
;
});
let
preferredSizeChangeCounter
=
0
;
const
preferredSizeChangeListener
=
part
.
onDidPreferredSizeChange
(()
=>
{
preferredSizeChangeCounter
++
;
});
// always a root group
const
rootGroup
=
part
.
groups
[
0
];
assert
.
equal
(
part
.
groups
.
length
,
1
);
...
...
@@ -141,7 +136,6 @@ suite('EditorGroupsService', () => {
assert
.
equal
(
part
.
groups
.
length
,
2
);
assert
.
equal
(
part
.
count
,
2
);
assert
.
ok
(
part
.
activeGroup
===
rootGroup
);
assert
.
equal
(
preferredSizeChangeCounter
,
1
);
assert
.
equal
(
rootGroup
.
label
,
'
Group 1
'
);
assert
.
equal
(
rightGroup
.
label
,
'
Group 2
'
);
...
...
@@ -189,7 +183,6 @@ suite('EditorGroupsService', () => {
assert
.
equal
(
part
.
groups
.
length
,
3
);
assert
.
ok
(
part
.
activeGroup
===
rightGroup
);
assert
.
ok
(
!
downGroup
.
activeControl
);
assert
.
equal
(
preferredSizeChangeCounter
,
2
);
assert
.
equal
(
rootGroup
.
label
,
'
Group 1
'
);
assert
.
equal
(
rightGroup
.
label
,
'
Group 2
'
);
assert
.
equal
(
downGroup
.
label
,
'
Group 3
'
);
...
...
@@ -208,13 +201,11 @@ suite('EditorGroupsService', () => {
part
.
moveGroup
(
downGroup
,
rightGroup
,
GroupDirection
.
DOWN
);
assert
.
equal
(
groupMovedCounter
,
1
);
assert
.
equal
(
preferredSizeChangeCounter
,
2
);
part
.
removeGroup
(
downGroup
);
assert
.
ok
(
!
part
.
getGroup
(
downGroup
.
id
));
assert
.
equal
(
didDispose
,
true
);
assert
.
equal
(
groupRemovedCounter
,
1
);
assert
.
equal
(
preferredSizeChangeCounter
,
3
);
assert
.
equal
(
part
.
groups
.
length
,
2
);
assert
.
ok
(
part
.
activeGroup
===
rightGroup
);
assert
.
equal
(
rootGroup
.
label
,
'
Group 1
'
);
...
...
@@ -254,13 +245,11 @@ suite('EditorGroupsService', () => {
assert
.
ok
(
part
.
activeGroup
===
rootGroup
);
part
.
setGroupOrientation
(
part
.
orientation
===
GroupOrientation
.
HORIZONTAL
?
GroupOrientation
.
VERTICAL
:
GroupOrientation
.
HORIZONTAL
);
assert
.
equal
(
preferredSizeChangeCounter
,
5
);
activeGroupChangeListener
.
dispose
();
groupAddedListener
.
dispose
();
groupRemovedListener
.
dispose
();
groupMovedListener
.
dispose
();
preferredSizeChangeListener
.
dispose
();
part
.
dispose
();
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录