Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d220b5a1
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
d220b5a1
编写于
3月 25, 2017
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
💄
上级
48ee232f
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
31 addition
and
42 deletion
+31
-42
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+9
-14
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
+5
-6
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+1
-2
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+9
-8
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+1
-4
src/vs/workbench/services/group/common/groupService.ts
src/vs/workbench/services/group/common/groupService.ts
+4
-5
src/vs/workbench/services/part/common/partService.ts
src/vs/workbench/services/part/common/partService.ts
+0
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+2
-2
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
d220b5a1
...
...
@@ -540,15 +540,14 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
}
// change part size along the main axis
public
resizePart
(
part
:
Parts
,
sizeChange
:
number
):
boolean
{
let
promise
=
TPromise
.
as
(
null
);
let
doLayout
=
false
;
let
newSashSize
:
number
=
0
;
let
visibleEditors
=
this
.
editorService
.
getVisibleEditors
().
length
;
public
resizePart
(
part
:
Parts
,
sizeChange
:
number
):
void
{
const
visibleEditors
=
this
.
editorService
.
getVisibleEditors
().
length
;
const
sizeChangePxWidth
=
this
.
workbenchSize
.
width
*
(
sizeChange
/
100
);
const
sizeChangePxHeight
=
this
.
workbenchSize
.
height
*
(
sizeChange
/
100
);
let
doLayout
=
false
;
let
newSashSize
:
number
=
0
;
switch
(
part
)
{
case
Parts
.
SIDEBAR_PART
:
newSashSize
=
this
.
sidebarWidth
+
sizeChangePxWidth
;
...
...
@@ -572,10 +571,9 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
if
(
visibleEditorCount
===
1
)
{
this
.
sidebarWidth
=
this
.
sidebarWidth
-
sizeChangePxWidth
;
doLayout
=
true
;
}
else
{
const
eGsSM
=
this
.
editorGroupService
.
getStacksModel
();
const
activeGroup
=
eGsSM
.
positionOfGroup
(
eGsSM
.
activeGroup
);
}
else
{
const
stacks
=
this
.
editorGroupService
.
getStacksModel
();
const
activeGroup
=
stacks
.
positionOfGroup
(
stacks
.
activeGroup
);
this
.
editorGroupService
.
resizeGroup
(
activeGroup
,
sizeChangePxWidth
);
doLayout
=
false
;
...
...
@@ -583,11 +581,8 @@ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontal
}
if
(
doLayout
)
{
promise
.
done
(()
=>
this
.
layout
(),
errors
.
onUnexpectedError
);
this
.
layout
(
);
}
// other parts not resizable, no error just silent
return
false
;
}
public
dispose
():
void
{
...
...
src/vs/workbench/browser/parts/editor/editorGroupsControl.ts
浏览文件 @
d220b5a1
...
...
@@ -78,7 +78,7 @@ export interface IEditorGroupsControl {
setGroupOrientation
(
orientation
:
GroupOrientation
):
void
;
getGroupOrientation
():
GroupOrientation
;
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
boolean
;
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
void
;
getRatio
():
number
[];
...
...
@@ -847,7 +847,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
}
// Resize the editor/group position - changes main axis
public
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
boolean
{
public
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
void
{
enum
VISIBLE_EDITORS
{
ONE
=
1
,
...
...
@@ -858,10 +858,10 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
const
visibleEditors
=
this
.
getVisibleEditorCount
();
if
(
visibleEditors
<=
VISIBLE_EDITORS
.
ONE
)
{
return
false
;
return
;
}
le
t
availableSize
=
this
.
totalSize
;
cons
t
availableSize
=
this
.
totalSize
;
const
activeGroupPosition
=
this
.
getActivePosition
();
switch
(
visibleEditors
)
{
...
...
@@ -898,9 +898,8 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
default
:
break
;
}
this
.
layout
(
this
.
dimension
);
return
true
;
this
.
layout
(
this
.
dimension
)
;
}
private
boundSiloSize
(
siloPosition
:
Position
,
sizeChangePx
:
number
):
number
{
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
d220b5a1
...
...
@@ -245,9 +245,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
this
.
_onTabOptionsChanged
.
fire
(
this
.
tabOptions
);
}
public
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
boolean
{
public
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
void
{
this
.
editorGroupsControl
.
resizeGroup
(
position
,
groupSizeChange
);
return
true
;
}
public
get
onEditorsChanged
():
Event
<
void
>
{
...
...
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
d220b5a1
...
...
@@ -1215,21 +1215,22 @@ export abstract class BaseResizeViewAction extends Action {
}
protected
resizePart
(
sizeChange
:
number
):
void
{
const
isEditorFocus
=
this
.
partService
.
hasFocus
(
Parts
.
EDITOR_PART
);
const
isSidebarFocus
=
this
.
partService
.
hasFocus
(
Parts
.
SIDEBAR_PART
);
const
isPanelFocus
=
this
.
partService
.
hasFocus
(
Parts
.
PANEL_PART
);
let
part
:
Parts
;
if
(
isSidebarFocus
)
{
this
.
partService
.
resizePart
(
Parts
.
SIDEBAR_PART
,
sizeChange
);
}
else
if
(
isPanelFocus
)
{
this
.
partService
.
resizePart
(
Parts
.
PANEL_PART
,
sizeChange
);
part
=
Parts
.
SIDEBAR_PART
;
}
else
if
(
isPanelFocus
)
{
part
=
Parts
.
PANEL_PART
;
}
else
if
(
isEditorFocus
)
{
part
=
Parts
.
EDITOR_PART
;
}
else
if
(
isEditorFocus
)
{
this
.
partService
.
resizePart
(
Parts
.
EDITOR_PART
,
sizeChange
);
if
(
part
)
{
this
.
partService
.
resizePart
(
part
,
sizeChange
);
}
return
;
}
}
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
d220b5a1
...
...
@@ -1149,18 +1149,15 @@ export class Workbench implements IPartService {
// Resize requested part along the main axis
// layout will do all the math for us and adjusts the other Parts
public
resizePart
(
part
:
Parts
,
sizeChange
:
number
):
void
{
switch
(
part
)
{
case
Parts
.
SIDEBAR_PART
:
case
Parts
.
PANEL_PART
:
case
Parts
.
EDITOR_PART
:
this
.
workbenchLayout
.
resizePart
(
part
,
sizeChange
);
break
;
// Cannot resize other parts
default
:
return
;
return
;
// Cannot resize other parts
}
return
;
}
...
...
src/vs/workbench/services/group/common/groupService.ts
浏览文件 @
d220b5a1
...
...
@@ -98,10 +98,10 @@ export interface IEditorGroupService {
*/
getGroupOrientation
():
GroupOrientation
;
/*
Resize visible editor groups
/*
*
*
Resize visible editor groups
*/
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
boolean
;
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
void
;
/**
* Adds the pinned state to an editor, removing it from being a preview editor.
...
...
@@ -131,5 +131,4 @@ export interface IEditorGroupService {
* Returns tab options.
*/
getTabOptions
():
ITabOptions
;
}
\ No newline at end of file
src/vs/workbench/services/part/common/partService.ts
浏览文件 @
d220b5a1
...
...
@@ -121,5 +121,4 @@ export interface IPartService {
* Resizes currently focused part on main access
*/
resizePart
(
part
:
Parts
,
sizeChange
:
number
):
void
;
}
\ No newline at end of file
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
d220b5a1
...
...
@@ -459,8 +459,8 @@ export class TestEditorGroupService implements IEditorGroupService {
return
'
vertical
'
;
}
public
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
boolean
{
return
true
;
public
resizeGroup
(
position
:
Position
,
groupSizeChange
:
number
):
void
{
}
public
pinEditor
(
group
:
IEditorGroup
,
input
:
IEditorInput
):
void
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录