Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6e3c4680
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,发现更多精彩内容 >>
提交
6e3c4680
编写于
10月 20, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #14020
上级
8531bff9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
16 deletion
+42
-16
src/vs/workbench/parts/files/browser/explorerViewlet.ts
src/vs/workbench/parts/files/browser/explorerViewlet.ts
+35
-12
src/vs/workbench/parts/files/browser/views/emptyView.ts
src/vs/workbench/parts/files/browser/views/emptyView.ts
+7
-4
未找到文件。
src/vs/workbench/parts/files/browser/explorerViewlet.ts
浏览文件 @
6e3c4680
...
...
@@ -39,6 +39,8 @@ export class ExplorerViewlet extends Viewlet {
private
explorerView
:
ExplorerView
;
private
openEditorsView
:
OpenEditorsView
;
private
emptyView
:
EmptyView
;
private
openEditorsVisible
:
boolean
;
private
lastFocusedView
:
ExplorerView
|
OpenEditorsView
|
EmptyView
;
private
focusListener
:
IDisposable
;
...
...
@@ -84,9 +86,13 @@ export class ExplorerViewlet extends Viewlet {
public
getActions
():
IAction
[]
{
if
(
this
.
openEditorsVisible
)
{
return
[];
}
else
{
}
if
(
this
.
explorerView
)
{
return
this
.
explorerView
.
getActions
();
}
return
[];
}
private
onConfigurationUpdated
(
config
:
IFilesConfiguration
):
TPromise
<
void
>
{
...
...
@@ -142,7 +148,7 @@ export class ExplorerViewlet extends Viewlet {
}
private
addExplorerView
():
void
{
let
explorerView
:
ExplorerView
|
EmptyView
;
let
explorer
OrEmpty
View
:
ExplorerView
|
EmptyView
;
// With a Workspace
if
(
this
.
contextService
.
getWorkspace
())
{
...
...
@@ -179,20 +185,21 @@ export class ExplorerViewlet extends Viewlet {
const
explorerInstantiator
=
this
.
instantiationService
.
createChild
(
new
ServiceCollection
([
IWorkbenchEditorService
,
delegatingEditorService
]));
const
headerSize
=
this
.
openEditorsVisible
?
undefined
:
0
;
// If open editors are not visible set header size explicitly to 0, otherwise const it be computed by super class.
this
.
explorerView
=
explorerView
=
explorerInstantiator
.
createInstance
(
ExplorerView
,
this
.
viewletState
,
this
.
getActionRunner
(),
this
.
viewletSettings
,
headerSize
);
this
.
explorerView
=
explorer
OrEmpty
View
=
explorerInstantiator
.
createInstance
(
ExplorerView
,
this
.
viewletState
,
this
.
getActionRunner
(),
this
.
viewletSettings
,
headerSize
);
}
// No workspace
else
{
explorer
View
=
this
.
instantiationService
.
createInstance
(
EmptyView
);
this
.
emptyView
=
explorerOrEmpty
View
=
this
.
instantiationService
.
createInstance
(
EmptyView
);
}
if
(
this
.
openEditorsVisible
)
{
this
.
splitView
.
addView
(
explorerView
);
this
.
splitView
.
addView
(
explorer
OrEmpty
View
);
}
else
{
explorerView
.
render
(
this
.
viewletContainer
.
getHTMLElement
(),
Orientation
.
VERTICAL
);
explorer
OrEmpty
View
.
render
(
this
.
viewletContainer
.
getHTMLElement
(),
Orientation
.
VERTICAL
);
}
this
.
views
.
push
(
explorerView
);
this
.
views
.
push
(
explorerOrEmptyView
);
}
public
getExplorerView
():
ExplorerView
{
...
...
@@ -214,12 +221,16 @@ export class ExplorerViewlet extends Viewlet {
public
focus
():
void
{
super
.
focus
();
const
hasOpenedEditors
=
!!
this
.
editorGroupService
.
getStacksModel
().
activeGroup
;
if
(
this
.
lastFocusedView
&&
this
.
lastFocusedView
.
isExpanded
()
&&
this
.
hasSelectionOrFocus
(
this
.
lastFocusedView
))
{
this
.
lastFocusedView
.
focusBody
();
return
;
if
(
this
.
lastFocusedView
!==
this
.
openEditorsView
||
hasOpenedEditors
)
{
this
.
lastFocusedView
.
focusBody
();
return
;
}
}
if
(
this
.
hasSelectionOrFocus
(
this
.
openEditorsView
))
{
if
(
this
.
hasSelectionOrFocus
(
this
.
openEditorsView
)
&&
hasOpenedEditors
)
{
return
this
.
openEditorsView
.
focusBody
();
}
...
...
@@ -227,14 +238,18 @@ export class ExplorerViewlet extends Viewlet {
return
this
.
explorerView
.
focusBody
();
}
if
(
this
.
openEditorsView
&&
this
.
openEditorsView
.
isExpanded
())
{
return
this
.
openEditorsView
.
focusBody
();
if
(
this
.
openEditorsView
&&
this
.
openEditorsView
.
isExpanded
()
&&
hasOpenedEditors
)
{
return
this
.
openEditorsView
.
focusBody
();
// we have entries in the opened editors view to focus on
}
if
(
this
.
explorerView
&&
this
.
explorerView
.
isExpanded
())
{
return
this
.
explorerView
.
focusBody
();
}
if
(
this
.
emptyView
&&
this
.
emptyView
.
isExpanded
())
{
return
this
.
emptyView
.
focusBody
();
}
return
this
.
openEditorsView
.
focus
();
}
...
...
@@ -262,6 +277,7 @@ export class ExplorerViewlet extends Viewlet {
public
layout
(
dimension
:
Dimension
):
void
{
this
.
dimension
=
dimension
;
if
(
this
.
openEditorsVisible
)
{
this
.
splitView
.
layout
(
dimension
.
height
);
}
else
if
(
this
.
explorerView
)
{
...
...
@@ -298,15 +314,22 @@ export class ExplorerViewlet extends Viewlet {
this
.
splitView
.
dispose
();
this
.
splitView
=
null
;
}
if
(
this
.
explorerView
)
{
this
.
explorerView
.
dispose
();
this
.
explorerView
=
null
;
}
if
(
this
.
openEditorsView
)
{
this
.
openEditorsView
.
dispose
();
this
.
openEditorsView
=
null
;
}
if
(
this
.
emptyView
)
{
this
.
emptyView
.
dispose
();
this
.
emptyView
=
null
;
}
if
(
this
.
focusListener
)
{
this
.
focusListener
.
dispose
();
this
.
focusListener
=
null
;
...
...
src/vs/workbench/parts/files/browser/views/emptyView.ts
浏览文件 @
6e3c4680
...
...
@@ -18,6 +18,7 @@ import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/action
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
class
EmptyView
extends
CollapsibleView
{
private
openFolderButton
:
Button
;
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
super
({
...
...
@@ -39,9 +40,9 @@ export class EmptyView extends CollapsibleView {
let
section
=
$
(
'
div.section
'
).
appendTo
(
container
);
let
b
utton
=
new
Button
(
section
);
b
utton
.
label
=
nls
.
localize
(
'
openFolder
'
,
"
Open Folder
"
);
b
utton
.
addListener2
(
'
click
'
,
()
=>
{
this
.
openFolderB
utton
=
new
Button
(
section
);
this
.
openFolderB
utton
.
label
=
nls
.
localize
(
'
openFolder
'
,
"
Open Folder
"
);
this
.
openFolderB
utton
.
addListener2
(
'
click
'
,
()
=>
{
this
.
runWorkbenchAction
(
env
.
isMacintosh
?
'
workbench.action.files.openFileFolder
'
:
'
workbench.action.files.openFolder
'
);
});
}
...
...
@@ -68,7 +69,9 @@ export class EmptyView extends CollapsibleView {
}
public
focusBody
():
void
{
// Ignore
if
(
this
.
openFolderButton
)
{
this
.
openFolderButton
.
getElement
().
focus
();
}
}
protected
reveal
(
element
:
any
,
relativeTop
?:
number
):
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录