Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f9911c74
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,发现更多精彩内容 >>
提交
f9911c74
编写于
6月 12, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'grid2x2'
上级
2b8f54b5
5c118a9e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
50 addition
and
2 deletion
+50
-2
src/vs/base/browser/ui/grid/grid.ts
src/vs/base/browser/ui/grid/grid.ts
+1
-0
src/vs/base/browser/ui/grid/gridview.ts
src/vs/base/browser/ui/grid/gridview.ts
+42
-1
src/vs/base/browser/ui/sash/sash.ts
src/vs/base/browser/ui/sash/sash.ts
+7
-1
未找到文件。
src/vs/base/browser/ui/grid/grid.ts
浏览文件 @
f9911c74
...
...
@@ -464,6 +464,7 @@ export class SerializableGrid<T extends ISerializableView> extends Grid<T> {
result
.
orientation
=
orientation
;
result
.
restoreViews
(
firstLeaf
.
view
,
orientation
,
root
);
result
.
initialLayoutContext
=
{
width
,
height
,
root
};
result
.
gridview
.
trySet2x2
();
return
result
;
}
...
...
src/vs/base/browser/ui/grid/gridview.ts
浏览文件 @
f9911c74
...
...
@@ -9,7 +9,7 @@ import 'vs/css!./gridview';
import
{
Event
,
anyEvent
,
Emitter
,
mapEvent
,
Relay
}
from
'
vs/base/common/event
'
;
import
{
Orientation
,
Sash
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
SplitView
,
IView
as
ISplitView
,
Sizing
,
ISplitViewStyles
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
empty
as
EmptyDisposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
empty
as
EmptyDisposable
,
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
$
,
append
}
from
'
vs/base/browser/dom
'
;
import
{
tail2
as
tail
}
from
'
vs/base/common/arrays
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
...
...
@@ -288,6 +288,22 @@ class BranchNode implements ISplitView, IDisposable {
this
.
_onDidChange
.
fire
();
}
trySet2x2
(
other
:
BranchNode
):
IDisposable
{
if
(
this
.
children
.
length
!==
2
||
other
.
children
.
length
!==
2
)
{
return
EmptyDisposable
;
}
if
(
this
.
getChildSize
(
0
)
!==
other
.
getChildSize
(
0
))
{
return
EmptyDisposable
;
}
const
mySash
=
this
.
splitview
.
sashes
[
0
];
const
otherSash
=
other
.
splitview
.
sashes
[
0
];
mySash
.
linkedSash
=
otherSash
;
otherSash
.
linkedSash
=
mySash
;
return
toDisposable
(()
=>
mySash
.
linkedSash
=
otherSash
.
linkedSash
=
undefined
);
}
dispose
():
void
{
for
(
const
child
of
this
.
children
)
{
child
.
dispose
();
...
...
@@ -409,6 +425,8 @@ export class GridView implements IDisposable {
private
onDidSashResetRelay
=
new
Relay
<
number
[]
>
();
readonly
onDidSashReset
:
Event
<
number
[]
>
=
this
.
onDidSashResetRelay
.
event
;
private
disposable2x2
:
IDisposable
=
EmptyDisposable
;
private
get
root
():
BranchNode
{
return
this
.
_root
;
}
...
...
@@ -483,6 +501,9 @@ export class GridView implements IDisposable {
}
addView
(
view
:
IView
,
size
:
number
|
Sizing
,
location
:
number
[]):
void
{
this
.
disposable2x2
.
dispose
();
this
.
disposable2x2
=
EmptyDisposable
;
const
[
rest
,
index
]
=
tail
(
location
);
const
[
pathToParent
,
parent
]
=
this
.
getNode
(
rest
);
...
...
@@ -512,6 +533,9 @@ export class GridView implements IDisposable {
}
removeView
(
location
:
number
[],
sizing
?:
Sizing
):
IView
{
this
.
disposable2x2
.
dispose
();
this
.
disposable2x2
=
EmptyDisposable
;
const
[
rest
,
index
]
=
tail
(
location
);
const
[
pathToParent
,
parent
]
=
this
.
getNode
(
rest
);
...
...
@@ -709,6 +733,23 @@ export class GridView implements IDisposable {
return
this
.
getNode
(
rest
,
child
,
path
);
}
trySet2x2
():
void
{
this
.
disposable2x2
.
dispose
();
this
.
disposable2x2
=
EmptyDisposable
;
if
(
this
.
root
.
children
.
length
!==
2
)
{
return
;
}
const
[
first
,
second
]
=
this
.
root
.
children
;
if
(
!
(
first
instanceof
BranchNode
)
||
!
(
second
instanceof
BranchNode
))
{
return
;
}
this
.
disposable2x2
=
first
.
trySet2x2
(
second
);
}
dispose
():
void
{
this
.
onDidSashResetRelay
.
dispose
();
this
.
root
.
dispose
();
...
...
src/vs/base/browser/ui/sash/sash.ts
浏览文件 @
f9911c74
...
...
@@ -96,6 +96,8 @@ export class Sash {
private
readonly
_onDidEnd
=
new
Emitter
<
void
>
();
readonly
onDidEnd
:
Event
<
void
>
=
this
.
_onDidEnd
.
event
;
linkedSash
:
Sash
|
undefined
=
undefined
;
private
orthogonalStartSashDisposables
:
IDisposable
[]
=
[];
private
_orthogonalStartSash
:
Sash
|
undefined
;
get
orthogonalStartSash
():
Sash
|
undefined
{
return
this
.
_orthogonalStartSash
;
}
...
...
@@ -178,6 +180,11 @@ export class Sash {
let
isMultisashResize
=
false
;
if
(
this
.
linkedSash
&&
!
(
e
as
any
).
__linkedSashEvent
)
{
(
e
as
any
).
__linkedSashEvent
=
true
;
this
.
linkedSash
.
onMouseDown
(
e
);
}
if
(
!
(
e
as
any
).
__orthogonalSashEvent
)
{
let
orthogonalSash
:
Sash
|
undefined
;
...
...
@@ -297,7 +304,6 @@ export class Sash {
const
startY
=
event
.
pageY
;
const
altKey
=
event
.
altKey
;
this
.
_onDidStart
.
fire
({
startX
:
startX
,
currentX
:
startX
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录