Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
f3efccad
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f3efccad
编写于
5月 08, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid: onDidSashReset
上级
7d523ccd
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
37 addition
and
14 deletion
+37
-14
src/vs/base/browser/ui/grid/grid.ts
src/vs/base/browser/ui/grid/grid.ts
+2
-0
src/vs/base/browser/ui/grid/gridview.ts
src/vs/base/browser/ui/grid/gridview.ts
+27
-6
src/vs/base/browser/ui/splitview/panelview.ts
src/vs/base/browser/ui/splitview/panelview.ts
+1
-1
src/vs/base/browser/ui/splitview/splitview.ts
src/vs/base/browser/ui/splitview/splitview.ts
+4
-6
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
+2
-0
src/vs/workbench/browser/parts/views/panelViewlet.ts
src/vs/workbench/browser/parts/views/panelViewlet.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/grid/grid.ts
浏览文件 @
f3efccad
...
...
@@ -10,6 +10,7 @@ import { Orientation } from 'vs/base/browser/ui/sash/sash';
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
tail2
as
tail
,
tail2
}
from
'
vs/base/common/arrays
'
;
import
{
orthogonal
,
IView
,
GridView
,
Sizing
as
GridViewSizing
}
from
'
./gridview
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
export
{
Orientation
}
from
'
./gridview
'
;
...
...
@@ -107,6 +108,7 @@ export class Grid<T extends IView> implements IDisposable {
get
width
():
number
{
return
this
.
gridview
.
width
;
}
get
height
():
number
{
return
this
.
gridview
.
height
;
}
get
onDidSashReset
():
Event
<
number
[]
>
{
return
this
.
gridview
.
onDidSashReset
;
}
constructor
(
container
:
HTMLElement
,
view
:
T
)
{
this
.
gridview
=
new
GridView
(
container
);
...
...
src/vs/base/browser/ui/grid/gridview.ts
浏览文件 @
f3efccad
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
'
vs/css!./gridview
'
;
import
{
Event
,
anyEvent
,
Emitter
,
mapEvent
}
from
'
vs/base/common/event
'
;
import
{
Event
,
anyEvent
,
Emitter
,
mapEvent
,
Relay
}
from
'
vs/base/common/event
'
;
import
{
Orientation
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
SplitView
,
IView
as
ISplitView
,
Sizing
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
empty
as
EmptyDisposable
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -85,7 +85,12 @@ class BranchNode implements ISplitView, IDisposable {
private
_onDidChange
:
Emitter
<
number
|
undefined
>
;
get
onDidChange
():
Event
<
number
|
undefined
>
{
return
this
.
_onDidChange
.
event
;
}
private
onDidChangeDisposable
:
IDisposable
;
private
childrenChangeDisposable
:
IDisposable
=
EmptyDisposable
;
private
_onDidSashReset
=
new
Emitter
<
number
[]
>
();
readonly
onDidSashReset
:
Event
<
number
[]
>
=
this
.
_onDidSashReset
.
event
;
private
splitviewSashResetDisposable
:
IDisposable
=
EmptyDisposable
;
private
childrenSashResetDisposable
:
IDisposable
=
EmptyDisposable
;
constructor
(
readonly
orientation
:
Orientation
,
...
...
@@ -97,11 +102,13 @@ class BranchNode implements ISplitView, IDisposable {
this
.
_onDidChange
=
new
Emitter
<
number
|
undefined
>
();
this
.
children
=
[];
this
.
onDidChangeDisposable
=
EmptyDisposable
;
this
.
element
=
$
(
'
.monaco-grid-branch-node
'
);
this
.
splitview
=
new
SplitView
(
this
.
element
,
{
orientation
:
this
.
orientation
});
this
.
splitview
.
layout
(
size
);
const
onDidSashReset
=
mapEvent
(
this
.
splitview
.
onDidSashReset
,
i
=>
[
i
]);
this
.
splitviewSashResetDisposable
=
onDidSashReset
(
this
.
_onDidSashReset
.
fire
,
this
.
_onDidSashReset
);
}
layout
(
size
:
number
):
void
{
...
...
@@ -172,8 +179,13 @@ class BranchNode implements ISplitView, IDisposable {
private
onDidChildrenChange
():
void
{
const
onDidChildrenChange
=
anyEvent
(...
this
.
children
.
map
(
c
=>
c
.
onDidChange
));
this
.
onDidChangeDisposable
.
dispose
();
this
.
onDidChangeDisposable
=
onDidChildrenChange
(
this
.
_onDidChange
.
fire
,
this
.
_onDidChange
);
this
.
childrenChangeDisposable
.
dispose
();
this
.
childrenChangeDisposable
=
onDidChildrenChange
(
this
.
_onDidChange
.
fire
,
this
.
_onDidChange
);
const
onDidChildrenSashReset
=
anyEvent
(...
this
.
children
.
map
((
c
,
i
)
=>
mapEvent
(
c
.
onDidSashReset
,
location
=>
[
i
,
...
location
])));
this
.
childrenSashResetDisposable
.
dispose
();
this
.
childrenSashResetDisposable
=
onDidChildrenSashReset
(
this
.
_onDidSashReset
.
fire
,
this
.
_onDidSashReset
);
this
.
_onDidChange
.
fire
();
}
...
...
@@ -182,7 +194,9 @@ class BranchNode implements ISplitView, IDisposable {
child
.
dispose
();
}
this
.
onDidChangeDisposable
.
dispose
();
this
.
splitviewSashResetDisposable
.
dispose
();
this
.
childrenSashResetDisposable
.
dispose
();
this
.
childrenChangeDisposable
.
dispose
();
this
.
splitview
.
dispose
();
}
}
...
...
@@ -195,6 +209,8 @@ class LeafNode implements ISplitView, IDisposable {
private
_orthogonalSize
:
number
;
get
orthogonalSize
():
number
{
return
this
.
_orthogonalSize
;
}
readonly
onDidSashReset
:
Event
<
number
[]
>
=
Event
.
None
;
constructor
(
readonly
view
:
IView
,
readonly
orientation
:
Orientation
,
...
...
@@ -281,6 +297,8 @@ export class GridView implements IDisposable {
private
element
:
HTMLElement
;
private
root
:
BranchNode
;
private
onDidSashResetRelay
=
new
Relay
<
number
[]
>
();
readonly
onDidSashReset
:
Event
<
number
[]
>
=
this
.
onDidSashResetRelay
.
event
;
get
orientation
():
Orientation
{
return
this
.
root
.
orientation
;
...
...
@@ -296,6 +314,7 @@ export class GridView implements IDisposable {
this
.
root
=
flipNode
(
oldRoot
,
oldRoot
.
orthogonalSize
,
oldRoot
.
size
)
as
BranchNode
;
this
.
element
.
appendChild
(
this
.
root
.
element
);
this
.
onDidSashResetRelay
.
input
=
this
.
root
.
onDidSashReset
;
this
.
root
.
layout
(
oldRoot
.
size
);
this
.
root
.
orthogonalLayout
(
oldRoot
.
orthogonalSize
);
...
...
@@ -315,6 +334,7 @@ export class GridView implements IDisposable {
this
.
element
=
append
(
container
,
$
(
'
.monaco-grid-view
'
));
this
.
root
=
new
BranchNode
(
Orientation
.
VERTICAL
);
this
.
element
.
appendChild
(
this
.
root
.
element
);
this
.
onDidSashResetRelay
.
input
=
this
.
root
.
onDidSashReset
;
}
layout
(
width
:
number
,
height
:
number
):
void
{
...
...
@@ -494,6 +514,7 @@ export class GridView implements IDisposable {
}
dispose
():
void
{
this
.
onDidSashResetRelay
.
dispose
();
this
.
root
.
dispose
();
}
}
\ No newline at end of file
src/vs/base/browser/ui/splitview/panelview.ts
浏览文件 @
f3efccad
...
...
@@ -375,7 +375,7 @@ export class PanelView implements IDisposable {
private
_onDidDrop
=
new
Emitter
<
{
from
:
Panel
,
to
:
Panel
}
>
();
readonly
onDidDrop
:
Event
<
{
from
:
Panel
,
to
:
Panel
}
>
=
this
.
_onDidDrop
.
event
;
readonly
onDidSashChange
:
Event
<
void
>
;
readonly
onDidSashChange
:
Event
<
number
>
;
constructor
(
container
:
HTMLElement
,
options
:
IPanelViewOptions
=
{})
{
this
.
dnd
=
options
.
dnd
;
...
...
src/vs/base/browser/ui/splitview/splitview.ts
浏览文件 @
f3efccad
...
...
@@ -117,9 +117,9 @@ export class SplitView implements IDisposable {
private
sashDragState
:
ISashDragState
;
private
state
:
State
=
State
.
Idle
;
private
_onDidSashChange
=
new
Emitter
<
void
>
();
private
_onDidSashChange
=
new
Emitter
<
number
>
();
readonly
onDidSashChange
=
this
.
_onDidSashChange
.
event
;
private
_onDidSashReset
=
new
Emitter
<
void
>
();
private
_onDidSashReset
=
new
Emitter
<
number
>
();
readonly
onDidSashReset
=
this
.
_onDidSashReset
.
event
;
get
length
():
number
{
...
...
@@ -194,10 +194,8 @@ export class SplitView implements IDisposable {
const
onStartDisposable
=
onStart
(
this
.
onSashStart
,
this
);
const
onChange
=
mapEvent
(
sash
.
onDidChange
,
sashEventMapper
);
const
onSashChangeDisposable
=
onChange
(
this
.
onSashChange
,
this
);
const
onEnd
=
mapEvent
<
void
,
void
>
(
sash
.
onDidEnd
,
()
=>
null
);
const
onEndDisposable
=
onEnd
(()
=>
this
.
_onDidSashChange
.
fire
());
const
onDidReset
=
mapEvent
<
void
,
void
>
(
sash
.
onDidReset
,
()
=>
null
);
const
onDidResetDisposable
=
onDidReset
(()
=>
this
.
_onDidSashReset
.
fire
());
const
onEndDisposable
=
sash
.
onDidEnd
(()
=>
this
.
_onDidSashChange
.
fire
(
firstIndex
(
this
.
sashItems
,
item
=>
item
.
sash
===
sash
)));
const
onDidResetDisposable
=
sash
.
onDidReset
(()
=>
this
.
_onDidSashReset
.
fire
(
firstIndex
(
this
.
sashItems
,
item
=>
item
.
sash
===
sash
)));
const
disposable
=
combinedDisposable
([
onStartDisposable
,
onSashChangeDisposable
,
onEndDisposable
,
onDidResetDisposable
,
sash
]);
const
sashItem
:
ISashItem
=
{
sash
,
disposable
};
...
...
src/vs/workbench/browser/parts/editor2/nextEditorPart.ts
浏览文件 @
f3efccad
...
...
@@ -450,6 +450,8 @@ export class NextEditorPart extends Part implements INextEditorGroupsService, IN
this
.
doSetGroupActive
(
initialGroup
);
}
this
.
gridWidget
.
onDidSashReset
(
e
=>
console
.
log
(
'
sash reset
'
,
e
));
// Signal restored
always
(
TPromise
.
join
(
this
.
groups
.
map
(
group
=>
group
.
whenRestored
)),
()
=>
this
.
whenRestoredComplete
(
void
0
));
...
...
src/vs/workbench/browser/parts/views/panelViewlet.ts
浏览文件 @
f3efccad
...
...
@@ -154,7 +154,7 @@ export class PanelViewlet extends Viewlet {
private
panelItems
:
IViewletPanelItem
[]
=
[];
private
panelview
:
PanelView
;
get
onDidSashChange
():
Event
<
void
>
{
get
onDidSashChange
():
Event
<
number
>
{
return
this
.
panelview
.
onDidSashChange
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录