Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
34c6ea92
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,发现更多精彩内容 >>
提交
34c6ea92
编写于
10月 18, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
horizontal: more layout fixes
上级
9e5eab5a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
10 deletion
+24
-10
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
...workbench/browser/parts/editor/sideBySideEditorControl.ts
+24
-10
未找到文件。
src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts
浏览文件 @
34c6ea92
...
...
@@ -1215,7 +1215,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// [ ! ]|[ ]: Moves only to the right/bottom but not outside of dimension to the right/bottom
case
Position
.
ONE
:
{
newPos
=
Math
.
max
(
0
,
Math
.
min
(
diffPos
,
this
.
totalSize
-
this
.
silosSize
[
Position
.
ONE
]));
newPos
=
Math
.
max
(
-
1
/* 1px border accomodation */
,
Math
.
min
(
diffPos
,
this
.
totalSize
-
this
.
silosSize
[
Position
.
ONE
]));
break
;
}
...
...
@@ -1223,19 +1223,19 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// [ ]|[ ! ]: Moves only to the left/top but not outside of dimension to the left/top
if
(
visibleEditorCount
===
2
)
{
newPos
=
Math
.
min
(
this
.
silosSize
[
Position
.
ONE
],
Math
.
max
(
0
,
this
.
silosSize
[
Position
.
ONE
]
+
diffPos
));
newPos
=
Math
.
min
(
this
.
silosSize
[
Position
.
ONE
],
Math
.
max
(
-
1
/* 1px border accomodation */
,
this
.
silosSize
[
Position
.
ONE
]
+
diffPos
));
}
// [ ]|[ ! ]|[ ]: Moves to left/top and right/bottom but not outside of dimensions on both sides
else
{
newPos
=
Math
.
min
(
this
.
totalSize
-
this
.
silosSize
[
Position
.
TWO
],
Math
.
max
(
0
,
this
.
silosSize
[
Position
.
ONE
]
+
diffPos
));
newPos
=
Math
.
min
(
this
.
totalSize
-
this
.
silosSize
[
Position
.
TWO
],
Math
.
max
(
-
1
/* 1px border accomodation */
,
this
.
silosSize
[
Position
.
ONE
]
+
diffPos
));
}
break
;
}
// [ ]|[ ]|[ ! ]: Moves to the right/bottom but not outside of dimension on the left/top side
case
Position
.
THREE
:
{
newPos
=
Math
.
min
(
this
.
silosSize
[
Position
.
ONE
]
+
this
.
silosSize
[
Position
.
TWO
],
Math
.
max
(
0
,
this
.
silosSize
[
Position
.
ONE
]
+
this
.
silosSize
[
Position
.
TWO
]
+
diffPos
));
newPos
=
Math
.
min
(
this
.
silosSize
[
Position
.
ONE
]
+
this
.
silosSize
[
Position
.
TWO
],
Math
.
max
(
-
1
/* 1px border accomodation */
,
this
.
silosSize
[
Position
.
ONE
]
+
this
.
silosSize
[
Position
.
TWO
]
+
diffPos
));
break
;
}
}
...
...
@@ -1299,7 +1299,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
// Move the editor to provide feedback to the user and add class
if
(
newPos
!==
null
)
{
this
.
silos
[
position
].
style
(
this
.
layoutVertically
?
{
left
:
`
${
newPos
}
px`
}
:
{
top
:
`
${
newPos
}
px`
}
);
this
.
posSilo
(
position
,
`
${
newPos
}
px`
);
this
.
silos
[
position
].
addClass
(
'
dragging
'
);
this
.
parent
.
addClass
(
'
dragging
'
);
}
...
...
@@ -1354,12 +1354,22 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
private
posSilo
(
pos
:
number
,
leftTop
:
string
|
number
,
rightBottom
?:
string
|
number
,
borderLeftTopWidth
?:
string
|
number
):
void
{
let
style
:
any
;
if
(
this
.
layoutVertically
)
{
style
=
{
left
:
leftTop
,
right
:
rightBottom
};
style
=
{
left
:
leftTop
};
if
(
typeof
rightBottom
===
'
number
'
||
typeof
rightBottom
===
'
string
'
)
{
style
[
'
right
'
]
=
rightBottom
;
}
if
(
typeof
borderLeftTopWidth
===
'
number
'
||
typeof
borderLeftTopWidth
===
'
string
'
)
{
style
[
'
borderLeftWidth
'
]
=
borderLeftTopWidth
;
}
}
else
{
style
=
{
top
:
leftTop
,
bottom
:
rightBottom
};
style
=
{
top
:
leftTop
};
if
(
typeof
rightBottom
===
'
number
'
||
typeof
rightBottom
===
'
string
'
)
{
style
[
'
bottom
'
]
=
rightBottom
;
}
if
(
typeof
borderLeftTopWidth
===
'
number
'
||
typeof
borderLeftTopWidth
===
'
string
'
)
{
style
[
'
borderTopWidth
'
]
=
borderLeftTopWidth
;
}
...
...
@@ -1765,11 +1775,15 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti
private
layoutEditor
(
position
:
Position
):
void
{
const
editorSize
=
this
.
silosSize
[
position
];
if
(
editorSize
&&
this
.
visibleEditors
[
position
])
{
cons
t
editorWidth
=
this
.
layoutVertically
?
editorSize
:
this
.
dimension
.
width
;
le
t
editorWidth
=
this
.
layoutVertically
?
editorSize
:
this
.
dimension
.
width
;
let
editorHeight
=
(
this
.
layoutVertically
?
this
.
dimension
.
height
:
this
.
silosSize
[
position
])
-
SideBySideEditorControl
.
EDITOR_TITLE_HEIGHT
;
if
(
!
this
.
layoutVertically
&&
position
!==
Position
.
ONE
)
{
editorHeight
--
;
// accomodate for 1px border in containers TWO, THREE when laying out horizontally
if
(
position
!==
Position
.
ONE
)
{
if
(
this
.
layoutVertically
)
{
editorWidth
--
;
// accomodate for 1px left-border in containers TWO, THREE when laying out vertically
}
else
{
editorHeight
--
;
// accomodate for 1px top-border in containers TWO, THREE when laying out horizontally
}
}
this
.
visibleEditors
[
position
].
layout
(
new
Dimension
(
editorWidth
,
editorHeight
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录