Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ca76092b
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,发现更多精彩内容 >>
提交
ca76092b
编写于
7月 15, 2019
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete Grid.View
上级
cfdc5898
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
32 addition
and
91 deletion
+32
-91
src/vs/base/browser/ui/grid/grid.ts
src/vs/base/browser/ui/grid/grid.ts
+2
-64
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+28
-27
src/vs/workbench/browser/parts/panel/panelPart.ts
src/vs/workbench/browser/parts/panel/panelPart.ts
+1
-0
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
+1
-0
未找到文件。
src/vs/base/browser/ui/grid/grid.ts
浏览文件 @
ca76092b
...
...
@@ -8,9 +8,7 @@ import { Orientation } from 'vs/base/browser/ui/sash/sash';
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
tail2
as
tail
,
equals
}
from
'
vs/base/common/arrays
'
;
import
{
orthogonal
,
IView
,
GridView
,
Sizing
as
GridViewSizing
,
Box
,
IGridViewStyles
,
IViewSize
}
from
'
./gridview
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
$
}
from
'
vs/base/browser/dom
'
;
import
{
LayoutPriority
}
from
'
vs/base/browser/ui/splitview/splitview
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
export
{
Orientation
,
Sizing
as
GridViewSizing
}
from
'
./gridview
'
;
...
...
@@ -187,7 +185,7 @@ export interface IGridOptions {
proportionalLayout
?:
boolean
;
}
export
class
Grid
<
T
extends
IView
>
extends
Disposable
{
export
class
Grid
<
T
extends
IView
=
IView
>
extends
Disposable
{
protected
gridview
:
GridView
;
private
views
=
new
Map
<
T
,
HTMLElement
>
();
...
...
@@ -644,63 +642,3 @@ export function createSerializedGrid(gridDescriptor: GridDescriptor): ISerialize
height
:
height
||
1
};
}
export
class
View
implements
IView
{
readonly
element
=
$
(
'
.grid-view-view
'
);
private
visible
=
false
;
private
width
:
number
|
undefined
;
private
height
:
number
|
undefined
;
private
orientation
:
Orientation
=
Orientation
.
HORIZONTAL
;
get
minimumWidth
():
number
{
return
this
.
visible
?
this
.
view
.
minimumWidth
:
0
;
}
get
maximumWidth
():
number
{
return
this
.
visible
?
this
.
view
.
maximumWidth
:
(
this
.
orientation
===
Orientation
.
HORIZONTAL
?
0
:
Number
.
POSITIVE_INFINITY
);
}
get
minimumHeight
():
number
{
return
this
.
visible
?
this
.
view
.
minimumHeight
:
0
;
}
get
maximumHeight
():
number
{
return
this
.
visible
?
this
.
view
.
maximumHeight
:
(
this
.
orientation
===
Orientation
.
VERTICAL
?
0
:
Number
.
POSITIVE_INFINITY
);
}
private
onDidChangeVisibility
=
new
Emitter
<
{
width
:
number
;
height
:
number
;
}
|
undefined
>
();
readonly
onDidChange
:
Event
<
{
width
:
number
;
height
:
number
;
}
|
undefined
>
;
get
priority
():
LayoutPriority
|
undefined
{
return
this
.
view
.
priority
;
}
get
snap
():
boolean
|
undefined
{
return
this
.
view
.
snap
;
}
constructor
(
private
view
:
IView
)
{
this
.
show
();
this
.
onDidChange
=
Event
.
any
(
this
.
onDidChangeVisibility
.
event
,
Event
.
filter
(
view
.
onDidChange
,
()
=>
this
.
visible
));
}
show
():
void
{
if
(
this
.
visible
)
{
return
;
}
this
.
visible
=
true
;
this
.
element
.
appendChild
(
this
.
view
.
element
);
this
.
onDidChangeVisibility
.
fire
(
typeof
this
.
width
===
'
number
'
?
{
width
:
this
.
width
,
height
:
this
.
height
!
}
:
undefined
);
}
hide
():
void
{
if
(
!
this
.
visible
)
{
return
;
}
this
.
visible
=
false
;
this
.
element
.
removeChild
(
this
.
view
.
element
);
this
.
onDidChangeVisibility
.
fire
(
undefined
);
}
layout
(
width
:
number
,
height
:
number
,
orientation
:
Orientation
):
void
{
this
.
orientation
=
orientation
;
if
(
!
this
.
visible
)
{
return
;
}
this
.
view
.
layout
(
width
,
height
,
orientation
);
this
.
width
=
width
;
this
.
height
=
height
;
}
}
\ No newline at end of file
src/vs/workbench/browser/layout.ts
浏览文件 @
ca76092b
...
...
@@ -27,13 +27,14 @@ import { IWindowService, MenuBarVisibility, getTitleBarStyle } from 'vs/platform
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
IEditorService
,
IResourceEditor
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorGroupsService
}
from
'
vs/workbench/services/editor/common/editorGroupsService
'
;
import
{
Sizing
,
Direction
,
Grid
,
View
}
from
'
vs/base/browser/ui/grid/grid
'
;
import
{
Sizing
,
Direction
,
Grid
}
from
'
vs/base/browser/ui/grid/grid
'
;
import
{
WorkbenchLegacyLayout
}
from
'
vs/workbench/browser/legacyLayout
'
;
import
{
IDimension
}
from
'
vs/platform/layout/browser/layoutService
'
;
import
{
Part
}
from
'
vs/workbench/browser/part
'
;
import
{
IStatusbarService
}
from
'
vs/platform/statusbar/common/statusbar
'
;
import
{
IActivityBarService
}
from
'
vs/workbench/services/activityBar/browser/activityBarService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IView
}
from
'
vs/base/browser/ui/grid/gridview
'
;
enum
Settings
{
MENUBAR_VISIBLE
=
'
window.menuBarVisibility
'
,
...
...
@@ -87,16 +88,16 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
private
parts
:
Map
<
string
,
Part
>
=
new
Map
<
string
,
Part
>
();
private
workbenchGrid
:
Grid
<
View
>
|
WorkbenchLegacyLayout
;
private
workbenchGrid
:
Grid
|
WorkbenchLegacyLayout
;
private
disposed
:
boolean
;
private
titleBarPartView
:
View
;
private
activityBarPartView
:
View
;
private
sideBarPartView
:
View
;
private
panelPartView
:
View
;
private
editorPartView
:
View
;
private
statusBarPartView
:
View
;
private
titleBarPartView
:
I
View
;
private
activityBarPartView
:
I
View
;
private
sideBarPartView
:
I
View
;
private
panelPartView
:
I
View
;
private
editorPartView
:
I
View
;
private
statusBarPartView
:
I
View
;
private
environmentService
:
IWorkbenchEnvironmentService
;
private
configurationService
:
IConfigurationService
;
...
...
@@ -701,12 +702,12 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
if
(
this
.
configurationService
.
getValue
(
'
workbench.useExperimentalGridLayout
'
))
{
// Create view wrappers for all parts
this
.
titleBarPartView
=
new
View
(
titleBar
)
;
this
.
sideBarPartView
=
new
View
(
sideBar
)
;
this
.
activityBarPartView
=
new
View
(
activityBar
)
;
this
.
editorPartView
=
new
View
(
editorPart
)
;
this
.
panelPartView
=
new
View
(
panelPart
)
;
this
.
statusBarPartView
=
new
View
(
statusBar
)
;
this
.
titleBarPartView
=
titleBar
;
this
.
sideBarPartView
=
sideBar
;
this
.
activityBarPartView
=
activityBar
;
this
.
editorPartView
=
editorPart
;
this
.
panelPartView
=
panelPart
;
this
.
statusBarPartView
=
statusBar
;
this
.
workbenchGrid
=
new
Grid
(
this
.
editorPartView
,
{
proportionalLayout
:
false
});
...
...
@@ -789,52 +790,52 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
// Hide parts
if
(
this
.
state
.
panel
.
hidden
)
{
this
.
panelPartView
.
hide
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
panelPartView
,
false
);
}
if
(
this
.
state
.
statusBar
.
hidden
)
{
this
.
statusBarPartView
.
hide
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
statusBarPartView
,
false
);
}
if
(
!
this
.
isVisible
(
Parts
.
TITLEBAR_PART
))
{
this
.
titleBarPartView
.
hide
(
);
if
(
titlebarInGrid
&&
!
this
.
isVisible
(
Parts
.
TITLEBAR_PART
))
{
this
.
workbenchGrid
.
setViewVisible
(
this
.
titleBarPartView
,
false
);
}
if
(
this
.
state
.
activityBar
.
hidden
)
{
this
.
activityBarPartView
.
hide
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
activityBarPartView
,
false
);
}
if
(
this
.
state
.
sideBar
.
hidden
)
{
this
.
sideBarPartView
.
hide
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
sideBarPartView
,
false
);
}
if
(
this
.
state
.
editor
.
hidden
)
{
this
.
editorPartView
.
hide
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
editorPartView
,
false
);
}
// Show visible parts
if
(
!
this
.
state
.
editor
.
hidden
)
{
this
.
editorPartView
.
show
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
editorPartView
,
true
);
}
if
(
!
this
.
state
.
statusBar
.
hidden
)
{
this
.
statusBarPartView
.
show
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
statusBarPartView
,
true
);
}
if
(
this
.
isVisible
(
Parts
.
TITLEBAR_PART
))
{
this
.
titleBarPartView
.
show
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
titleBarPartView
,
true
);
}
if
(
!
this
.
state
.
activityBar
.
hidden
)
{
this
.
activityBarPartView
.
show
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
activityBarPartView
,
true
);
}
if
(
!
this
.
state
.
sideBar
.
hidden
)
{
this
.
sideBarPartView
.
show
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
sideBarPartView
,
true
);
}
if
(
!
this
.
state
.
panel
.
hidden
)
{
this
.
panelPartView
.
show
(
);
this
.
workbenchGrid
.
setViewVisible
(
this
.
panelPartView
,
true
);
}
}
...
...
src/vs/workbench/browser/parts/panel/panelPart.ts
浏览文件 @
ca76092b
...
...
@@ -59,6 +59,7 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
readonly
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
priority
:
LayoutPriority
=
LayoutPriority
.
Low
;
readonly
snap
=
true
;
//#endregion
...
...
src/vs/workbench/browser/parts/sidebar/sidebarPart.ts
浏览文件 @
ca76092b
...
...
@@ -47,6 +47,7 @@ export class SidebarPart extends CompositePart<Viewlet> implements IViewletServi
readonly
maximumHeight
:
number
=
Number
.
POSITIVE_INFINITY
;
readonly
priority
:
LayoutPriority
=
LayoutPriority
.
Low
;
readonly
snap
=
true
;
//#endregion
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录