Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4f5c928f
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,发现更多精彩内容 >>
提交
4f5c928f
编写于
6月 08, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sash: use linked sashes as arrays
上级
44b554db
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
89 addition
and
82 deletion
+89
-82
src/vs/base/browser/ui/grid/gridview.ts
src/vs/base/browser/ui/grid/gridview.ts
+19
-18
src/vs/base/browser/ui/sash/sash.css
src/vs/base/browser/ui/sash/sash.css
+8
-8
src/vs/base/browser/ui/sash/sash.ts
src/vs/base/browser/ui/sash/sash.ts
+48
-42
src/vs/base/browser/ui/splitview/splitview.ts
src/vs/base/browser/ui/splitview/splitview.ts
+14
-14
未找到文件。
src/vs/base/browser/ui/grid/gridview.ts
浏览文件 @
4f5c928f
...
@@ -72,6 +72,10 @@ export interface IGridViewOptions {
...
@@ -72,6 +72,10 @@ export interface IGridViewOptions {
styles
?:
IGridViewStyles
;
styles
?:
IGridViewStyles
;
}
}
function
arrayIdentity
<
T
>
(
el
:
T
):
T
[]
{
return
el
?
[
el
]
:
[];
}
class
BranchNode
implements
ISplitView
,
IDisposable
{
class
BranchNode
implements
ISplitView
,
IDisposable
{
readonly
element
:
HTMLElement
;
readonly
element
:
HTMLElement
;
...
@@ -136,10 +140,10 @@ class BranchNode implements ISplitView, IDisposable {
...
@@ -136,10 +140,10 @@ class BranchNode implements ISplitView, IDisposable {
private
splitviewSashResetDisposable
:
IDisposable
=
EmptyDisposable
;
private
splitviewSashResetDisposable
:
IDisposable
=
EmptyDisposable
;
private
childrenSashResetDisposable
:
IDisposable
=
EmptyDisposable
;
private
childrenSashResetDisposable
:
IDisposable
=
EmptyDisposable
;
get
orthogonalStartSash
():
Sash
|
undefined
{
return
this
.
splitview
.
orthogonalStartSash
;
}
get
linkedStartSashes
():
Sash
[]
{
return
this
.
splitview
.
linkedStartSashes
;
}
set
orthogonalStartSash
(
sash
:
Sash
|
undefined
)
{
this
.
splitview
.
orthogonalStartSash
=
sash
;
}
set
linkedStartSashes
(
sashes
:
Sash
[])
{
this
.
splitview
.
linkedStartSashes
=
sashes
;
}
get
orthogonalEndSash
():
Sash
|
undefined
{
return
this
.
splitview
.
orthogonalEndSash
;
}
get
linkedEndSashes
():
Sash
[]
{
return
this
.
splitview
.
linkedEndSashes
;
}
set
orthogonalEndSash
(
sash
:
Sash
|
undefined
)
{
this
.
splitview
.
orthogonalEndSash
=
sash
;
}
set
linkedEndSashes
(
sashes
:
Sash
[])
{
this
.
splitview
.
linkedEndSashes
=
sashes
;
}
constructor
(
constructor
(
readonly
orientation
:
Orientation
,
readonly
orientation
:
Orientation
,
...
@@ -195,15 +199,15 @@ class BranchNode implements ISplitView, IDisposable {
...
@@ -195,15 +199,15 @@ class BranchNode implements ISplitView, IDisposable {
const
last
=
index
===
this
.
splitview
.
length
;
const
last
=
index
===
this
.
splitview
.
length
;
this
.
splitview
.
addView
(
node
,
size
,
index
);
this
.
splitview
.
addView
(
node
,
size
,
index
);
this
.
children
.
splice
(
index
,
0
,
node
);
this
.
children
.
splice
(
index
,
0
,
node
);
node
.
orthogonalStartSash
=
this
.
splitview
.
sashes
[
index
-
1
]
;
node
.
linkedStartSashes
=
arrayIdentity
(
this
.
splitview
.
sashes
[
index
-
1
])
;
node
.
orthogonalEndSash
=
this
.
splitview
.
sashes
[
index
]
;
node
.
linkedEndSashes
=
arrayIdentity
(
this
.
splitview
.
sashes
[
index
])
;
if
(
!
first
)
{
if
(
!
first
)
{
this
.
children
[
index
-
1
].
orthogonalEndSash
=
this
.
splitview
.
sashes
[
index
-
1
]
;
this
.
children
[
index
-
1
].
linkedEndSashes
=
arrayIdentity
(
this
.
splitview
.
sashes
[
index
-
1
])
;
}
}
if
(
!
last
)
{
if
(
!
last
)
{
this
.
children
[
index
+
1
].
orthogonalStartSash
=
this
.
splitview
.
sashes
[
index
]
;
this
.
children
[
index
+
1
].
linkedStartSashes
=
arrayIdentity
(
this
.
splitview
.
sashes
[
index
])
;
}
}
this
.
onDidChildrenChange
();
this
.
onDidChildrenChange
();
...
@@ -220,11 +224,11 @@ class BranchNode implements ISplitView, IDisposable {
...
@@ -220,11 +224,11 @@ class BranchNode implements ISplitView, IDisposable {
this
.
children
.
splice
(
index
,
1
);
this
.
children
.
splice
(
index
,
1
);
if
(
!
first
)
{
if
(
!
first
)
{
this
.
children
[
index
-
1
].
orthogonalEndSash
=
this
.
splitview
.
sashes
[
index
-
1
]
;
this
.
children
[
index
-
1
].
linkedEndSashes
=
arrayIdentity
(
this
.
splitview
.
sashes
[
index
-
1
])
;
}
}
if
(
!
last
)
{
// [0,1,2,3] (2) => [0,1,3]
if
(
!
last
)
{
// [0,1,2,3] (2) => [0,1,3]
this
.
children
[
index
].
orthogonalStartSash
=
this
.
splitview
.
sashes
[
Math
.
max
(
index
-
1
,
0
)]
;
this
.
children
[
index
].
linkedStartSashes
=
arrayIdentity
(
this
.
splitview
.
sashes
[
Math
.
max
(
index
-
1
,
0
)])
;
}
}
this
.
onDidChildrenChange
();
this
.
onDidChildrenChange
();
...
@@ -244,7 +248,7 @@ class BranchNode implements ISplitView, IDisposable {
...
@@ -244,7 +248,7 @@ class BranchNode implements ISplitView, IDisposable {
}
}
this
.
splitview
.
swapViews
(
from
,
to
);
this
.
splitview
.
swapViews
(
from
,
to
);
[
this
.
children
[
from
].
orthogonalStartSash
,
this
.
children
[
from
].
orthogonalEndSash
,
this
.
children
[
to
].
orthogonalStartSash
,
this
.
children
[
to
].
orthogonalEndSash
]
=
[
this
.
children
[
to
].
orthogonalStartSash
,
this
.
children
[
to
].
orthogonalEndSash
,
this
.
children
[
from
].
orthogonalStartSash
,
this
.
children
[
from
].
orthogonalEndSash
];
[
this
.
children
[
from
].
linkedStartSashes
,
this
.
children
[
from
].
linkedEndSashes
,
this
.
children
[
to
].
linkedStartSashes
,
this
.
children
[
to
].
linkedEndSashes
]
=
[
this
.
children
[
to
].
linkedStartSashes
,
this
.
children
[
to
].
linkedEndSashes
,
this
.
children
[
from
].
linkedStartSashes
,
this
.
children
[
from
].
linkedEndSashes
];
[
this
.
children
[
from
],
this
.
children
[
to
]]
=
[
this
.
children
[
to
],
this
.
children
[
from
]];
[
this
.
children
[
from
],
this
.
children
[
to
]]
=
[
this
.
children
[
to
],
this
.
children
[
from
]];
}
}
...
@@ -342,13 +346,10 @@ class LeafNode implements ISplitView, IDisposable {
...
@@ -342,13 +346,10 @@ class LeafNode implements ISplitView, IDisposable {
return
mapEvent
(
this
.
view
.
onDidChange
,
this
.
orientation
===
Orientation
.
HORIZONTAL
?
({
width
})
=>
width
:
({
height
})
=>
height
);
return
mapEvent
(
this
.
view
.
onDidChange
,
this
.
orientation
===
Orientation
.
HORIZONTAL
?
({
width
})
=>
width
:
({
height
})
=>
height
);
}
}
set
orthogonalStartSash
(
sash
:
Sash
)
{
get
linkedStartSashes
():
Sash
[]
{
return
[];
}
// noop
set
linkedStartSashes
(
sashes
:
Sash
[])
{
}
}
get
linkedEndSashes
():
Sash
[]
{
return
[];
}
set
linkedEndSashes
(
sashes
:
Sash
[])
{
}
set
orthogonalEndSash
(
sash
:
Sash
)
{
// noop
}
layout
(
size
:
number
):
void
{
layout
(
size
:
number
):
void
{
this
.
_size
=
size
;
this
.
_size
=
size
;
...
...
src/vs/base/browser/ui/sash/sash.css
浏览文件 @
4f5c928f
...
@@ -51,8 +51,8 @@
...
@@ -51,8 +51,8 @@
cursor
:
n-resize
;
cursor
:
n-resize
;
}
}
.monaco-sash
:not
(
.disabled
)
.
orthogonal
-start
::before
,
.monaco-sash
:not
(
.disabled
)
.
linked
-start
::before
,
.monaco-sash
:not
(
.disabled
)
.
orthogonal
-end
::after
{
.monaco-sash
:not
(
.disabled
)
.
linked
-end
::after
{
content
:
' '
;
content
:
' '
;
height
:
8px
;
height
:
8px
;
width
:
8px
;
width
:
8px
;
...
@@ -62,22 +62,22 @@
...
@@ -62,22 +62,22 @@
position
:
absolute
;
position
:
absolute
;
}
}
.monaco-sash.
orthogonal
-start.vertical
::before
{
.monaco-sash.
linked
-start.vertical
::before
{
left
:
-2px
;
left
:
-2px
;
top
:
-4px
;
top
:
-4px
;
}
}
.monaco-sash.
orthogonal
-end.vertical
::after
{
.monaco-sash.
linked
-end.vertical
::after
{
left
:
-2px
;
left
:
-2px
;
bottom
:
-4px
;
bottom
:
-4px
;
}
}
.monaco-sash.
orthogonal
-start.horizontal
::before
{
.monaco-sash.
linked
-start.horizontal
::before
{
top
:
-2px
;
top
:
-2px
;
left
:
-4px
;
left
:
-4px
;
}
}
.monaco-sash.
orthogonal
-end.horizontal
::after
{
.monaco-sash.
linked
-end.horizontal
::after
{
top
:
-2px
;
top
:
-2px
;
right
:
-4px
;
right
:
-4px
;
}
}
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
background
:
cyan
;
background
:
cyan
;
}
}
.monaco-sash.debug
:not
(
.disabled
)
.
orthogonal
-start
::before
,
.monaco-sash.debug
:not
(
.disabled
)
.
linked
-start
::before
,
.monaco-sash.debug
:not
(
.disabled
)
.
orthogonal
-end
::after
{
.monaco-sash.debug
:not
(
.disabled
)
.
linked
-end
::after
{
background
:
red
;
background
:
red
;
}
}
\ No newline at end of file
src/vs/base/browser/ui/sash/sash.ts
浏览文件 @
4f5c928f
...
@@ -12,11 +12,11 @@ import { isMacintosh } from 'vs/base/common/platform';
...
@@ -12,11 +12,11 @@ import { isMacintosh } from 'vs/base/common/platform';
import
*
as
types
from
'
vs/base/common/types
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
import
{
EventType
,
GestureEvent
,
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
EventType
,
GestureEvent
,
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
StandardMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Event
,
Emitter
,
anyEvent
,
mapEvent
}
from
'
vs/base/common/event
'
;
import
{
getElementsByTagName
,
EventHelper
,
createStyleSheet
,
addDisposableListener
,
Dimension
,
append
,
$
,
addClass
,
removeClass
,
toggleClass
}
from
'
vs/base/browser/dom
'
;
import
{
getElementsByTagName
,
EventHelper
,
createStyleSheet
,
addDisposableListener
,
Dimension
,
append
,
$
,
addClass
,
removeClass
,
toggleClass
}
from
'
vs/base/browser/dom
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
import
{
domEvent
}
from
'
vs/base/browser/event
'
;
const
DEBUG
=
fals
e
;
const
DEBUG
=
tru
e
;
export
interface
ISashLayoutProvider
{
}
export
interface
ISashLayoutProvider
{
}
...
@@ -42,8 +42,8 @@ export interface ISashEvent {
...
@@ -42,8 +42,8 @@ export interface ISashEvent {
export
interface
ISashOptions
{
export
interface
ISashOptions
{
orientation
?:
Orientation
;
orientation
?:
Orientation
;
orthogonalStartSash
?:
Sash
;
linkedStartSashes
?:
Sash
[]
;
orthogonalEndSash
?:
Sash
;
linkedEndSashes
?:
Sash
[]
;
}
}
export
enum
Orientation
{
export
enum
Orientation
{
...
@@ -96,36 +96,40 @@ export class Sash {
...
@@ -96,36 +96,40 @@ export class Sash {
private
readonly
_onDidEnd
=
new
Emitter
<
void
>
();
private
readonly
_onDidEnd
=
new
Emitter
<
void
>
();
readonly
onDidEnd
:
Event
<
void
>
=
this
.
_onDidEnd
.
event
;
readonly
onDidEnd
:
Event
<
void
>
=
this
.
_onDidEnd
.
event
;
private
orthogonalStartSash
Disposables
:
IDisposable
[]
=
[];
private
linkedStartSashes
Disposables
:
IDisposable
[]
=
[];
private
_
orthogonalStartSash
:
Sash
|
undefined
;
private
_
linkedStartSashes
:
Sash
[]
=
[]
;
get
orthogonalStartSash
():
Sash
|
undefined
{
return
this
.
_orthogonalStartSash
;
}
get
linkedStartSashes
():
Sash
[]
{
return
this
.
_linkedStartSashes
;
}
set
orthogonalStartSash
(
sash
:
Sash
|
undefined
)
{
set
linkedStartSashes
(
sashes
:
Sash
[]
)
{
this
.
orthogonalStartSashDisposables
=
dispose
(
this
.
orthogonalStartSash
Disposables
);
this
.
linkedStartSashesDisposables
=
dispose
(
this
.
linkedStartSashes
Disposables
);
if
(
sash
)
{
if
(
sashes
.
length
>
0
)
{
sash
.
onDidEnablementChange
(
this
.
onOrthogonalStartSashEnablementChange
,
this
,
this
.
orthogonalStartSashDisposables
);
mapEvent
(
anyEvent
(...
sashes
.
map
(
s
=>
s
.
onDidEnablementChange
)),
()
=>
sashes
.
map
(
s
=>
s
.
state
))
this
.
onOrthogonalStartSashEnablementChange
(
sash
.
state
);
(
this
.
onLinkedStartSashEnablementChange
,
this
,
this
.
linkedStartSashesDisposables
);
this
.
onLinkedStartSashEnablementChange
(
sashes
.
map
(
s
=>
s
.
state
));
}
else
{
}
else
{
this
.
on
OrthogonalStartSashEnablementChange
(
SashState
.
Disabled
);
this
.
on
LinkedStartSashEnablementChange
([]
);
}
}
this
.
_
orthogonalStartSash
=
sash
;
this
.
_
linkedStartSashes
=
sashes
;
}
}
private
orthogonalEndSashDisposables
:
IDisposable
[]
=
[];
private
linkedEndSashDisposables
:
IDisposable
[]
=
[];
private
_orthogonalEndSash
:
Sash
|
undefined
;
private
_linkedEndSash
:
Sash
[]
=
[];
get
orthogonalEndSash
():
Sash
|
undefined
{
return
this
.
_orthogonalEndSash
;
}
get
linkedEndSash
():
Sash
[]
{
return
this
.
_linkedEndSash
;
}
set
orthogonalEndSash
(
sash
:
Sash
|
undefined
)
{
set
linkedEndSash
(
sashes
:
Sash
[])
{
this
.
orthogonalEndSashDisposables
=
dispose
(
this
.
orthogonalEndSashDisposables
);
this
.
linkedEndSashDisposables
=
dispose
(
this
.
linkedEndSashDisposables
);
if
(
sashes
)
{
mapEvent
(
anyEvent
(...
sashes
.
map
(
s
=>
s
.
onDidEnablementChange
)),
()
=>
sashes
.
map
(
s
=>
s
.
state
))
(
this
.
onLinkedEndSashEnablementChange
,
this
,
this
.
linkedEndSashDisposables
);
if
(
sash
)
{
this
.
onLinkedEndSashEnablementChange
(
sashes
.
map
(
s
=>
s
.
state
));
sash
.
onDidEnablementChange
(
this
.
onOrthogonalEndSashEnablementChange
,
this
,
this
.
orthogonalEndSashDisposables
);
this
.
onOrthogonalEndSashEnablementChange
(
sash
.
state
);
}
else
{
}
else
{
this
.
on
OrthogonalEndSashEnablementChange
(
SashState
.
Disabled
);
this
.
on
LinkedEndSashEnablementChange
([]
);
}
}
this
.
_
orthogonalEndSash
=
sash
;
this
.
_
linkedEndSash
=
sashes
;
}
}
constructor
(
container
:
HTMLElement
,
layoutProvider
:
ISashLayoutProvider
,
options
:
ISashOptions
=
{})
{
constructor
(
container
:
HTMLElement
,
layoutProvider
:
ISashLayoutProvider
,
options
:
ISashOptions
=
{})
{
...
@@ -151,8 +155,8 @@ export class Sash {
...
@@ -151,8 +155,8 @@ export class Sash {
this
.
hidden
=
false
;
this
.
hidden
=
false
;
this
.
layoutProvider
=
layoutProvider
;
this
.
layoutProvider
=
layoutProvider
;
this
.
orthogonalStartSash
=
options
.
orthogonalStartSash
;
this
.
linkedStartSashes
=
options
.
linkedStartSashes
||
[]
;
this
.
orthogonalEndSash
=
options
.
orthogonalEndSash
;
this
.
linkedEndSash
=
options
.
linkedEndSashes
||
[]
;
toggleClass
(
this
.
el
,
'
debug
'
,
DEBUG
);
toggleClass
(
this
.
el
,
'
debug
'
,
DEBUG
);
}
}
...
@@ -178,27 +182,29 @@ export class Sash {
...
@@ -178,27 +182,29 @@ export class Sash {
let
isMultisashResize
=
false
;
let
isMultisashResize
=
false
;
if
(
!
(
e
as
any
).
__
orthogonal
SashEvent
)
{
if
(
!
(
e
as
any
).
__
linked
SashEvent
)
{
let
orthogonalSash
:
Sash
|
undefined
;
let
linkedSashes
:
Sash
[]
=
[]
;
if
(
this
.
orientation
===
Orientation
.
VERTICAL
)
{
if
(
this
.
orientation
===
Orientation
.
VERTICAL
)
{
if
(
e
.
offsetY
<=
4
)
{
if
(
e
.
offsetY
<=
4
)
{
orthogonalSash
=
this
.
orthogonalStartSash
;
linkedSashes
=
this
.
linkedStartSashes
;
}
else
if
(
e
.
offsetY
>=
this
.
el
.
clientHeight
-
4
)
{
}
else
if
(
e
.
offsetY
>=
this
.
el
.
clientHeight
-
4
)
{
orthogonalSash
=
this
.
orthogonal
EndSash
;
linkedSashes
=
this
.
linked
EndSash
;
}
}
}
else
{
}
else
{
if
(
e
.
offsetX
<=
4
)
{
if
(
e
.
offsetX
<=
4
)
{
orthogonalSash
=
this
.
orthogonalStartSash
;
linkedSashes
=
this
.
linkedStartSashes
;
}
else
if
(
e
.
offsetX
>=
this
.
el
.
clientWidth
-
4
)
{
}
else
if
(
e
.
offsetX
>=
this
.
el
.
clientWidth
-
4
)
{
orthogonalSash
=
this
.
orthogonal
EndSash
;
linkedSashes
=
this
.
linked
EndSash
;
}
}
}
}
if
(
orthogonalSash
)
{
if
(
linkedSashes
.
length
>
0
)
{
isMultisashResize
=
true
;
for
(
const
sash
of
linkedSashes
)
{
(
e
as
any
).
__orthogonalSashEvent
=
true
;
isMultisashResize
=
true
;
orthogonalSash
.
onMouseDown
(
e
);
(
e
as
any
).
__linkedSashEvent
=
true
;
sash
.
onMouseDown
(
e
);
}
}
}
}
}
...
@@ -368,17 +374,17 @@ export class Sash {
...
@@ -368,17 +374,17 @@ export class Sash {
return
this
.
hidden
;
return
this
.
hidden
;
}
}
private
on
OrthogonalStartSashEnablementChange
(
state
:
SashState
):
void
{
private
on
LinkedStartSashEnablementChange
(
states
:
SashState
[]
):
void
{
toggleClass
(
this
.
el
,
'
orthogonal-start
'
,
state
!==
SashState
.
Disabled
);
toggleClass
(
this
.
el
,
'
linked-start
'
,
states
.
some
(
state
=>
state
!==
SashState
.
Disabled
)
);
}
}
private
on
OrthogonalEndSashEnablementChange
(
state
:
SashState
):
void
{
private
on
LinkedEndSashEnablementChange
(
states
:
SashState
[]
):
void
{
toggleClass
(
this
.
el
,
'
orthogonal-end
'
,
state
!==
SashState
.
Disabled
);
toggleClass
(
this
.
el
,
'
linked-end
'
,
states
.
some
(
state
=>
state
!==
SashState
.
Disabled
)
);
}
}
dispose
():
void
{
dispose
():
void
{
this
.
orthogonalStartSashDisposables
=
dispose
(
this
.
orthogonalStartSash
Disposables
);
this
.
linkedStartSashesDisposables
=
dispose
(
this
.
linkedStartSashes
Disposables
);
this
.
orthogonalEndSashDisposables
=
dispose
(
this
.
orthogonal
EndSashDisposables
);
this
.
linkedEndSashDisposables
=
dispose
(
this
.
linked
EndSashDisposables
);
if
(
this
.
el
&&
this
.
el
.
parentElement
)
{
if
(
this
.
el
&&
this
.
el
.
parentElement
)
{
this
.
el
.
parentElement
.
removeChild
(
this
.
el
);
this
.
el
.
parentElement
.
removeChild
(
this
.
el
);
...
...
src/vs/base/browser/ui/splitview/splitview.ts
浏览文件 @
4f5c928f
...
@@ -27,8 +27,8 @@ const defaultStyles: ISplitViewStyles = {
...
@@ -27,8 +27,8 @@ const defaultStyles: ISplitViewStyles = {
export
interface
ISplitViewOptions
{
export
interface
ISplitViewOptions
{
orientation
?:
Orientation
;
// default Orientation.VERTICAL
orientation
?:
Orientation
;
// default Orientation.VERTICAL
styles
?:
ISplitViewStyles
;
styles
?:
ISplitViewStyles
;
orthogonal
StartSash
?:
Sash
;
linked
StartSash
?:
Sash
;
orthogonal
EndSash
?:
Sash
;
linked
EndSash
?:
Sash
;
}
}
export
interface
IView
{
export
interface
IView
{
...
@@ -139,24 +139,24 @@ export class SplitView implements IDisposable {
...
@@ -139,24 +139,24 @@ export class SplitView implements IDisposable {
return
this
.
viewItems
.
length
;
return
this
.
viewItems
.
length
;
}
}
private
_
orthogonalStartSash
:
Sash
|
undefined
;
private
_
linkedStartSashes
:
Sash
[]
=
[]
;
get
orthogonalStartSash
():
Sash
|
undefined
{
return
this
.
_orthogonalStartSash
;
}
get
linkedStartSashes
():
Sash
[]
{
return
this
.
_linkedStartSashes
;
}
set
orthogonalStartSash
(
sash
:
Sash
|
undefined
)
{
set
linkedStartSashes
(
sashes
:
Sash
[]
)
{
for
(
const
sashItem
of
this
.
sashItems
)
{
for
(
const
sashItem
of
this
.
sashItems
)
{
sashItem
.
sash
.
orthogonalStartSash
=
sash
;
sashItem
.
sash
.
linkedStartSashes
=
sashes
;
}
}
this
.
_
orthogonalStartSash
=
sash
;
this
.
_
linkedStartSashes
=
sashes
;
}
}
private
_
orthogonalEndSash
:
Sash
|
undefined
;
private
_
linkedEndSashes
:
Sash
[]
=
[]
;
get
orthogonalEndSash
():
Sash
|
undefined
{
return
this
.
_orthogonalEndSash
;
}
get
linkedEndSashes
():
Sash
[]
{
return
this
.
_linkedEndSashes
;
}
set
orthogonalEndSash
(
sash
:
Sash
|
undefined
)
{
set
linkedEndSashes
(
sashes
:
Sash
[]
)
{
for
(
const
sashItem
of
this
.
sashItems
)
{
for
(
const
sashItem
of
this
.
sashItems
)
{
sashItem
.
sash
.
orthogonalEndSash
=
sash
;
sashItem
.
sash
.
linkedEndSash
=
sashes
;
}
}
this
.
_
orthogonalEndSash
=
sash
;
this
.
_
linkedEndSashes
=
sashes
;
}
}
get
sashes
():
Sash
[]
{
get
sashes
():
Sash
[]
{
...
@@ -235,8 +235,8 @@ export class SplitView implements IDisposable {
...
@@ -235,8 +235,8 @@ export class SplitView implements IDisposable {
const
layoutProvider
=
this
.
orientation
===
Orientation
.
VERTICAL
?
{
getHorizontalSashTop
:
sash
=>
this
.
getSashPosition
(
sash
)
}
:
{
getVerticalSashLeft
:
sash
=>
this
.
getSashPosition
(
sash
)
};
const
layoutProvider
=
this
.
orientation
===
Orientation
.
VERTICAL
?
{
getHorizontalSashTop
:
sash
=>
this
.
getSashPosition
(
sash
)
}
:
{
getVerticalSashLeft
:
sash
=>
this
.
getSashPosition
(
sash
)
};
const
sash
=
new
Sash
(
this
.
sashContainer
,
layoutProvider
,
{
const
sash
=
new
Sash
(
this
.
sashContainer
,
layoutProvider
,
{
orientation
,
orientation
,
orthogonalStartSash
:
this
.
orthogonalStartSash
,
linkedStartSashes
:
this
.
linkedStartSashes
,
orthogonalEndSash
:
this
.
orthogonalEndSash
linkedEndSashes
:
this
.
linkedEndSashes
});
});
const
sashEventMapper
=
this
.
orientation
===
Orientation
.
VERTICAL
const
sashEventMapper
=
this
.
orientation
===
Orientation
.
VERTICAL
?
(
e
:
IBaseSashEvent
)
=>
({
sash
,
start
:
e
.
startY
,
current
:
e
.
currentY
})
?
(
e
:
IBaseSashEvent
)
=>
({
sash
,
start
:
e
.
startY
,
current
:
e
.
currentY
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录