Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7324bc17
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,发现更多精彩内容 >>
提交
7324bc17
编写于
8月 28, 2019
作者:
S
SteVen Batten
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
prevent editor taking up more than its share
fixes #79897
上级
f03f5fde
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
3 deletion
+28
-3
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+17
-0
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+4
-3
src/vs/workbench/services/layout/browser/layoutService.ts
src/vs/workbench/services/layout/browser/layoutService.ts
+5
-0
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+2
-0
未找到文件。
src/vs/workbench/browser/layout.ts
浏览文件 @
7324bc17
...
@@ -608,6 +608,23 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
...
@@ -608,6 +608,23 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
return
offset
;
return
offset
;
}
}
getMaximumEditorDimensions
():
Dimension
{
const
takenWidth
=
(
this
.
isVisible
(
Parts
.
ACTIVITYBAR_PART
)
?
this
.
activityBarPartView
.
minimumWidth
:
0
)
+
(
this
.
isVisible
(
Parts
.
SIDEBAR_PART
)
?
this
.
sideBarPartView
.
minimumWidth
:
0
)
+
(
this
.
isVisible
(
Parts
.
PANEL_PART
)
&&
this
.
state
.
panel
.
position
===
Position
.
RIGHT
?
this
.
panelPartView
.
minimumWidth
:
0
);
const
takenHeight
=
(
this
.
isVisible
(
Parts
.
TITLEBAR_PART
)
?
this
.
titleBarPartView
.
minimumHeight
:
0
)
+
(
this
.
isVisible
(
Parts
.
STATUSBAR_PART
)
?
this
.
statusBarPartView
.
minimumHeight
:
0
)
+
(
this
.
isVisible
(
Parts
.
PANEL_PART
)
&&
this
.
state
.
panel
.
position
===
Position
.
BOTTOM
?
this
.
panelPartView
.
minimumHeight
:
0
);
const
availableWidth
=
this
.
dimension
.
width
-
takenWidth
;
const
availableHeight
=
this
.
dimension
.
height
-
takenHeight
;
return
{
width
:
availableWidth
,
height
:
availableHeight
};
}
getWorkbenchContainer
():
HTMLElement
{
getWorkbenchContainer
():
HTMLElement
{
return
this
.
parent
;
return
this
.
parent
;
}
}
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
7324bc17
...
@@ -140,7 +140,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
...
@@ -140,7 +140,7 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
@
IThemeService
themeService
:
IThemeService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IStorageService
storageService
:
IStorageService
,
@
IStorageService
storageService
:
IStorageService
,
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
@
IWorkbenchLayoutService
private
readonly
layoutService
:
IWorkbenchLayoutService
)
{
)
{
super
(
Parts
.
EDITOR_PART
,
{
hasTitle
:
false
},
themeService
,
storageService
,
layoutService
);
super
(
Parts
.
EDITOR_PART
,
{
hasTitle
:
false
},
themeService
,
storageService
,
layoutService
);
...
@@ -780,9 +780,10 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
...
@@ -780,9 +780,10 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
//#region Part
//#region Part
get
minimumWidth
():
number
{
return
this
.
centeredLayoutWidget
.
minimumWidth
;
}
// TODO @sbatten @joao find something better to prevent editor taking over #79897
get
minimumWidth
():
number
{
return
Math
.
min
(
this
.
centeredLayoutWidget
.
minimumWidth
,
this
.
layoutService
.
getMaximumEditorDimensions
().
width
);
}
get
maximumWidth
():
number
{
return
this
.
centeredLayoutWidget
.
maximumWidth
;
}
get
maximumWidth
():
number
{
return
this
.
centeredLayoutWidget
.
maximumWidth
;
}
get
minimumHeight
():
number
{
return
this
.
centeredLayoutWidget
.
minimumHeight
;
}
get
minimumHeight
():
number
{
return
Math
.
min
(
this
.
centeredLayoutWidget
.
minimumHeight
,
this
.
layoutService
.
getMaximumEditorDimensions
().
height
)
;
}
get
maximumHeight
():
number
{
return
this
.
centeredLayoutWidget
.
maximumHeight
;
}
get
maximumHeight
():
number
{
return
this
.
centeredLayoutWidget
.
maximumHeight
;
}
readonly
snap
=
true
;
readonly
snap
=
true
;
...
...
src/vs/workbench/services/layout/browser/layoutService.ts
浏览文件 @
7324bc17
...
@@ -144,6 +144,11 @@ export interface IWorkbenchLayoutService extends ILayoutService {
...
@@ -144,6 +144,11 @@ export interface IWorkbenchLayoutService extends ILayoutService {
*/
*/
setPanelPosition
(
position
:
Position
):
void
;
setPanelPosition
(
position
:
Position
):
void
;
/**
* Gets the maximum possible size for editor.
*/
getMaximumEditorDimensions
():
Dimension
;
/**
/**
* Returns the element that is parent of the workbench element.
* Returns the element that is parent of the workbench element.
*/
*/
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
7324bc17
...
@@ -541,6 +541,8 @@ export class TestLayoutService implements IWorkbenchLayoutService {
...
@@ -541,6 +541,8 @@ export class TestLayoutService implements IWorkbenchLayoutService {
public
addClass
(
_clazz
:
string
):
void
{
}
public
addClass
(
_clazz
:
string
):
void
{
}
public
removeClass
(
_clazz
:
string
):
void
{
}
public
removeClass
(
_clazz
:
string
):
void
{
}
public
getMaximumEditorDimensions
():
Dimension
{
throw
new
Error
(
'
not implemented
'
);
}
public
getWorkbenchContainer
():
HTMLElement
{
throw
new
Error
(
'
not implemented
'
);
}
public
getWorkbenchContainer
():
HTMLElement
{
throw
new
Error
(
'
not implemented
'
);
}
public
getWorkbenchElement
():
HTMLElement
{
throw
new
Error
(
'
not implemented
'
);
}
public
getWorkbenchElement
():
HTMLElement
{
throw
new
Error
(
'
not implemented
'
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录