Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b48eef3f
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,发现更多精彩内容 >>
提交
b48eef3f
编写于
10月 17, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dnd of tabs
上级
a27dd340
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
19 deletion
+23
-19
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
...workbench/browser/parts/editor/sideBySideEditorControl.ts
+23
-19
未找到文件。
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
浏览文件 @
b48eef3f
...
...
@@ -948,15 +948,16 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
function
positionOverlay
(
e
:
DragEvent
,
groups
:
number
,
position
:
Position
):
void
{
const
target
=
<
HTMLElement
>
e
.
target
;
const
posXOnOverlay
=
e
.
offsetX
;
const
overlayIsSplit
=
typeof
overlay
.
getProperty
(
splitToPropertyKey
)
===
'
number
'
;
const
overlayWidth
=
target
.
clientWidth
;
const
splitThreshold
=
overlayIsSplit
?
overlayWidth
/
5
:
overlayWidth
/
10
;
const
isCopy
=
(
e
.
ctrlKey
&&
!
isMacintosh
)
||
(
e
.
altKey
&&
isMacintosh
);
const
draggedEditor
=
TitleControl
.
getDraggedEditor
();
const
isOverSplitLeft
=
posXOnOverlay
<
splitThreshold
;
const
isOverSplitRight
=
posXOnOverlay
+
splitThreshold
>
overlayWidth
;
const
overlaySize
=
$this
.
layoutVertically
?
target
.
clientWidth
:
target
.
clientHeight
;
const
splitThreshold
=
overlayIsSplit
?
overlaySize
/
5
:
overlaySize
/
10
;
const
posOnOverlay
=
$this
.
layoutVertically
?
e
.
offsetX
:
e
.
offsetY
;
const
isOverSplitLeftOrUp
=
posOnOverlay
<
splitThreshold
;
const
isOverSplitRightOrBottom
=
posOnOverlay
+
splitThreshold
>
overlaySize
;
let
splitTarget
:
Position
;
...
...
@@ -970,12 +971,12 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
const
positionOfDraggedEditor
=
stacks
.
positionOfGroup
(
draggedEditor
.
group
);
switch
(
positionOfDraggedEditor
)
{
case
Position
.
LEFT
:
if
(
position
===
Position
.
CENTER
&&
isOverSplitRight
)
{
if
(
position
===
Position
.
CENTER
&&
isOverSplitRight
OrBottom
)
{
splitTarget
=
Position
.
CENTER
;
// allow to move single editor from LEFT to CENTER
}
break
;
case
Position
.
CENTER
:
if
(
position
===
Position
.
LEFT
&&
isOverSplitLeft
)
{
if
(
position
===
Position
.
LEFT
&&
isOverSplitLeft
OrUp
)
{
splitTarget
=
Position
.
LEFT
;
// allow to move single editor from CENTER to LEFT
}
break
;
...
...
@@ -986,9 +987,9 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// Any other case, check for mouse position
else
{
if
(
isOverSplitRight
)
{
if
(
isOverSplitRight
OrBottom
)
{
splitTarget
=
(
position
===
Position
.
LEFT
)
?
Position
.
CENTER
:
Position
.
RIGHT
;
}
else
if
(
isOverSplitLeft
)
{
}
else
if
(
isOverSplitLeft
OrUp
)
{
splitTarget
=
(
position
===
Position
.
LEFT
)
?
Position
.
LEFT
:
Position
.
CENTER
;
}
}
...
...
@@ -1002,15 +1003,18 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
}
// Update overlay styles
if
(
canSplit
&&
isOverSplitRight
)
{
overlay
.
style
({
left
:
'
50%
'
,
width
:
'
50%
'
,
});
}
else
if
(
canSplit
&&
isOverSplitLeft
)
{
overlay
.
style
({
width
:
'
50%
'
});
if
(
canSplit
&&
isOverSplitRightOrBottom
)
{
if
(
$this
.
layoutVertically
)
{
overlay
.
style
({
left
:
'
50%
'
,
width
:
'
50%
'
});
}
else
{
overlay
.
style
({
top
:
'
50%
'
,
height
:
'
50%
'
});
}
}
else
if
(
canSplit
&&
isOverSplitLeftOrUp
)
{
if
(
$this
.
layoutVertically
)
{
overlay
.
style
({
width
:
'
50%
'
});
}
else
{
overlay
.
style
({
height
:
'
50%
'
});
}
}
else
{
overlay
.
style
({
left
:
'
0
'
,
...
...
@@ -1067,7 +1071,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
}
}
//
cons
t a dropped file open inside Code (only if dropped over editor area)
//
le
t a dropped file open inside Code (only if dropped over editor area)
this
.
toDispose
.
push
(
DOM
.
addDisposableListener
(
node
,
DOM
.
EventType
.
DROP
,
(
e
:
DragEvent
)
=>
{
if
(
e
.
target
===
node
)
{
DOM
.
EventHelper
.
stop
(
e
,
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录