Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
92171d8c
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,发现更多精彩内容 >>
提交
92171d8c
编写于
6月 19, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
grid - some centered layout cleanup
上级
6a1ca400
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
14 addition
and
43 deletion
+14
-43
src/vs/base/browser/ui/centered/centeredViewLayout.css
src/vs/base/browser/ui/centered/centeredViewLayout.css
+1
-1
src/vs/workbench/browser/parts/editor/baseEditor.ts
src/vs/workbench/browser/parts/editor/baseEditor.ts
+0
-7
src/vs/workbench/browser/parts/editor/binaryEditor.ts
src/vs/workbench/browser/parts/editor/binaryEditor.ts
+0
-4
src/vs/workbench/browser/parts/editor/editorPart.ts
src/vs/workbench/browser/parts/editor/editorPart.ts
+13
-10
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
+0
-5
src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
+0
-4
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
+0
-4
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
.../workbench/parts/preferences/browser/preferencesEditor.ts
+0
-8
未找到文件。
src/vs/base/browser/ui/centered/centeredViewLayout.css
浏览文件 @
92171d8c
...
...
@@ -3,6 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.
monaco-workbench
>
.part.editor
>
.content
.
centered-view-layout
{
.centered-view-layout
{
height
:
100%
;
}
src/vs/workbench/browser/parts/editor/baseEditor.ts
浏览文件 @
92171d8c
...
...
@@ -143,13 +143,6 @@ export abstract class BaseEditor extends Panel implements IEditor {
this
.
_group
=
group
;
}
/**
* Subclasses can set this to false if it does not make sense to center editor input.
*/
supportsCenteredLayout
():
boolean
{
return
true
;
}
protected
getEditorMemento
<
T
>
(
storageService
:
IStorageService
,
editorGroupService
:
IEditorGroupsService
,
key
:
string
,
limit
:
number
=
10
):
IEditorMemento
<
T
>
{
const
mementoKey
=
`
${
this
.
getId
()}${
key
}
`
;
...
...
src/vs/workbench/browser/parts/editor/binaryEditor.ts
浏览文件 @
92171d8c
...
...
@@ -116,10 +116,6 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor {
return
this
.
metadata
;
}
public
supportsCenteredLayout
():
boolean
{
return
false
;
}
public
clearInput
():
void
{
// Clear Meta
...
...
src/vs/workbench/browser/parts/editor/editorPart.ts
浏览文件 @
92171d8c
...
...
@@ -89,13 +89,13 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
private
mostRecentActiveGroups
:
GroupIdentifier
[]
=
[];
private
container
:
HTMLElement
;
private
centeredLayoutWidget
:
CenteredViewLayout
;
private
gridWidget
:
SerializableGrid
<
IEditorGroupView
>
;
private
_whenRestored
:
TPromise
<
void
>
;
private
whenRestoredComplete
:
TValueCallback
<
void
>
;
private
previousUIState
:
IEditorPartUIState
;
private
centeredViewLayout
:
CenteredViewLayout
;
constructor
(
id
:
string
,
...
...
@@ -708,7 +708,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
const
separatorBorderStyle
=
{
separatorBorder
:
this
.
gridSeparatorBorder
};
this
.
gridWidget
.
style
(
separatorBorderStyle
);
this
.
centered
ViewLayou
t
.
styles
(
separatorBorderStyle
);
this
.
centered
LayoutWidge
t
.
styles
(
separatorBorderStyle
);
}
createContentArea
(
parent
:
HTMLElement
):
HTMLElement
{
...
...
@@ -720,7 +720,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
// Grid control with center layout
this
.
doCreateGridControl
();
this
.
centered
ViewLayout
=
new
CenteredViewLayout
(
this
.
container
,
this
.
getGridAsView
(),
this
.
globalMemento
[
EditorPart
.
EDITOR_PART_CENTERED_VIEW_STORAGE_KEY
]
);
this
.
centered
LayoutWidget
=
this
.
_register
(
new
CenteredViewLayout
(
this
.
container
,
this
.
getGridAsView
(),
this
.
globalMemento
[
EditorPart
.
EDITOR_PART_CENTERED_VIEW_STORAGE_KEY
])
);
// Drop support
this
.
_register
(
this
.
instantiationService
.
createInstance
(
EditorDropTarget
,
this
,
this
.
container
));
...
...
@@ -741,11 +741,11 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
}
centerLayout
(
active
:
boolean
):
void
{
this
.
centered
ViewLayou
t
.
activate
(
active
);
this
.
centered
LayoutWidge
t
.
activate
(
active
);
}
isLayoutCentered
():
boolean
{
return
this
.
centered
ViewLayou
t
.
isActive
();
return
this
.
centered
LayoutWidge
t
.
isActive
();
}
private
doCreateGridControl
():
void
{
...
...
@@ -801,6 +801,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
}
private
doCreateGridControlWithState
(
serializedGrid
:
ISerializedGrid
,
activeGroupId
:
GroupIdentifier
,
editorGroupViewsToReuse
?:
IEditorGroupView
[]):
void
{
// Determine group views to reuse if any
let
reuseGroupViews
:
IEditorGroupView
[];
if
(
editorGroupViewsToReuse
)
{
...
...
@@ -839,9 +840,10 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
this
.
gridWidget
=
gridWidget
;
if
(
gridWidget
)
{
if
(
this
.
centered
ViewLayou
t
)
{
this
.
centered
ViewLayou
t
.
resetView
(
this
.
getGridAsView
());
if
(
this
.
centered
LayoutWidge
t
)
{
this
.
centered
LayoutWidge
t
.
resetView
(
this
.
getGridAsView
());
}
this
.
_onDidSizeConstraintsChange
.
input
=
gridWidget
.
onDidChange
;
}
...
...
@@ -999,7 +1001,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
// Layout Grid
try
{
this
.
centered
ViewLayou
t
.
layout
(
this
.
dimension
.
width
,
this
.
dimension
.
height
);
this
.
centered
LayoutWidge
t
.
layout
(
this
.
dimension
.
width
,
this
.
dimension
.
height
);
}
catch
(
error
)
{
this
.
gridError
(
error
);
}
...
...
@@ -1024,7 +1026,9 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
this
.
memento
[
EditorPart
.
EDITOR_PART_UI_STATE_STORAGE_KEY
]
=
uiState
;
}
}
this
.
globalMemento
[
EditorPart
.
EDITOR_PART_CENTERED_VIEW_STORAGE_KEY
]
=
this
.
centeredViewLayout
.
state
;
// Persist centered view state
this
.
globalMemento
[
EditorPart
.
EDITOR_PART_CENTERED_VIEW_STORAGE_KEY
]
=
this
.
centeredLayoutWidget
.
state
;
// Forward to all groups
this
.
groupViews
.
forEach
(
group
=>
group
.
shutdown
());
...
...
@@ -1042,7 +1046,6 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor
if
(
this
.
gridWidget
)
{
this
.
gridWidget
.
dispose
();
}
this
.
centeredViewLayout
.
dispose
();
super
.
dispose
();
}
...
...
src/vs/workbench/browser/parts/editor/media/titlecontrol.css
浏览文件 @
92171d8c
...
...
@@ -11,11 +11,6 @@
flex
:
1
;
}
.monaco-workbench
>
.part.editor
>
.content
.editor-group-container.centered
>
.title
.title-label
{
flex-direction
:
row
;
justify-content
:
center
;
}
.monaco-workbench
>
.part.editor
>
.content
.editor-group-container
>
.title
.title-label
a
,
.monaco-workbench
>
.part.editor
>
.content
.editor-group-container
>
.title
.tabs-container
>
.tab
.tab-label
a
{
text-decoration
:
none
;
...
...
src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
浏览文件 @
92171d8c
...
...
@@ -151,10 +151,6 @@ export class SideBySideEditor extends BaseEditor {
return
this
.
detailsEditor
;
}
supportsCenteredLayout
():
boolean
{
return
false
;
}
private
updateInput
(
oldInput
:
SideBySideEditorInput
,
newInput
:
SideBySideEditorInput
,
options
:
EditorOptions
,
token
:
CancellationToken
):
Thenable
<
void
>
{
if
(
!
newInput
.
matches
(
oldInput
))
{
if
(
oldInput
)
{
...
...
src/vs/workbench/browser/parts/editor/textDiffEditor.ts
浏览文件 @
92171d8c
...
...
@@ -163,10 +163,6 @@ export class TextDiffEditor extends BaseTextEditor implements ITextDiffEditor {
}
}
public
supportsCenteredLayout
():
boolean
{
return
false
;
}
private
restoreTextDiffEditorViewState
(
input
:
EditorInput
):
boolean
{
if
(
input
instanceof
DiffEditorInput
)
{
const
resource
=
this
.
toDiffEditorViewStateResource
(
input
);
...
...
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
浏览文件 @
92171d8c
...
...
@@ -205,10 +205,6 @@ export class PreferencesEditor extends BaseEditor {
super
.
clearInput
();
}
public
supportsCenteredLayout
():
boolean
{
return
false
;
}
protected
setEditorVisible
(
visible
:
boolean
,
group
:
IEditorGroup
):
void
{
this
.
sideBySidePreferencesWidget
.
setEditorVisible
(
visible
,
group
);
super
.
setEditorVisible
(
visible
,
group
);
...
...
@@ -1053,10 +1049,6 @@ export class DefaultPreferencesEditor extends BaseTextEditor {
this
.
getControl
().
layout
(
dimension
);
}
public
supportsCenteredLayout
():
boolean
{
return
false
;
}
protected
getAriaLabel
():
string
{
return
nls
.
localize
(
'
preferencesAriaLabel
'
,
"
Default preferences. Readonly text editor.
"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录