Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4ac4a062
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,体验更适合开发者的 AI 搜索 >>
提交
4ac4a062
编写于
2月 09, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
open editors debt: remove openEditors.visible === 0 to hide the view
上级
446cd36a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
38 deletion
+4
-38
src/vs/workbench/parts/files/common/files.ts
src/vs/workbench/parts/files/common/files.ts
+0
-3
src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts
...workbench/parts/files/electron-browser/explorerViewlet.ts
+3
-34
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
...nch/parts/files/electron-browser/views/openEditorsView.ts
+1
-1
未找到文件。
src/vs/workbench/parts/files/common/files.ts
浏览文件 @
4ac4a062
...
...
@@ -40,7 +40,6 @@ export interface IExplorerView {
*/
const
explorerViewletVisibleId
=
'
explorerViewletVisible
'
;
const
filesExplorerFocusId
=
'
filesExplorerFocus
'
;
const
openEditorsVisibleId
=
'
openEditorsVisible
'
;
const
openEditorsFocusId
=
'
openEditorsFocus
'
;
const
explorerViewletFocusId
=
'
explorerViewletFocus
'
;
const
explorerResourceIsFolderId
=
'
explorerResourceIsFolder
'
;
...
...
@@ -50,11 +49,9 @@ export const ExplorerViewletVisibleContext = new RawContextKey<boolean>(explorer
export
const
ExplorerFolderContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceIsFolderId
,
false
);
export
const
ExplorerRootContext
=
new
RawContextKey
<
boolean
>
(
explorerResourceIsRootId
,
false
);
export
const
FilesExplorerFocusedContext
=
new
RawContextKey
<
boolean
>
(
filesExplorerFocusId
,
true
);
export
const
OpenEditorsVisibleContext
=
new
RawContextKey
<
boolean
>
(
openEditorsVisibleId
,
false
);
export
const
OpenEditorsFocusedContext
=
new
RawContextKey
<
boolean
>
(
openEditorsFocusId
,
true
);
export
const
ExplorerFocusedContext
=
new
RawContextKey
<
boolean
>
(
explorerViewletFocusId
,
true
);
export
const
OpenEditorsVisibleCondition
=
ContextKeyExpr
.
has
(
openEditorsVisibleId
);
export
const
FilesExplorerFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
explorerViewletVisibleId
),
ContextKeyExpr
.
has
(
filesExplorerFocusId
),
ContextKeyExpr
.
not
(
InputFocusedContextKey
));
export
const
ExplorerFocusCondition
=
ContextKeyExpr
.
and
(
ContextKeyExpr
.
has
(
explorerViewletVisibleId
),
ContextKeyExpr
.
has
(
explorerViewletFocusId
),
ContextKeyExpr
.
not
(
InputFocusedContextKey
));
...
...
src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts
浏览文件 @
4ac4a062
...
...
@@ -11,9 +11,9 @@ import { IActionRunner } from 'vs/base/common/actions';
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
Builder
}
from
'
vs/base/browser/builder
'
;
import
{
VIEWLET_ID
,
ExplorerViewletVisibleContext
,
IFilesConfiguration
,
OpenEditorsVisibleContext
,
OpenEditorsVisibleCondition
,
IExplorerViewlet
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
VIEWLET_ID
,
ExplorerViewletVisibleContext
,
IFilesConfiguration
,
IExplorerViewlet
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
PersistentViewsViewlet
,
IViewletViewOptions
,
ViewsViewletPanel
}
from
'
vs/workbench/browser/parts/views/viewsViewlet
'
;
import
{
IConfigurationService
,
IConfigurationChangeEvent
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
ActionRunner
,
FileViewletState
}
from
'
vs/workbench/parts/files/electron-browser/views/explorerViewer
'
;
import
{
ExplorerView
,
IExplorerViewOptions
}
from
'
vs/workbench/parts/files/electron-browser/views/explorerView
'
;
import
{
EmptyView
}
from
'
vs/workbench/parts/files/electron-browser/views/emptyView
'
;
...
...
@@ -38,23 +38,16 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
export
class
ExplorerViewletViewsContribution
extends
Disposable
implements
IWorkbenchContribution
{
private
openEditorsVisibleContextKey
:
IContextKey
<
boolean
>
;
constructor
(
@
IWorkspaceContextService
private
workspaceContextService
:
IWorkspaceContextService
,
@
IConfigurationService
private
configurationService
:
IConfigurationService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
)
{
super
();
this
.
registerViews
();
this
.
openEditorsVisibleContextKey
=
OpenEditorsVisibleContext
.
bindTo
(
contextKeyService
);
this
.
updateOpenEditorsVisibility
();
this
.
_register
(
workspaceContextService
.
onDidChangeWorkbenchState
(()
=>
this
.
registerViews
()));
this
.
_register
(
workspaceContextService
.
onDidChangeWorkspaceFolders
(()
=>
this
.
registerViews
()));
this
.
_register
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
this
.
onConfigurationUpdated
(
e
)));
}
private
registerViews
():
void
{
...
...
@@ -104,7 +97,6 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
location
:
ViewLocation
.
Explorer
,
ctor
:
OpenEditorsView
,
order
:
0
,
when
:
OpenEditorsVisibleCondition
,
canToggleVisibility
:
true
};
}
...
...
@@ -130,16 +122,6 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
canToggleVisibility
:
false
};
}
private
onConfigurationUpdated
(
e
:
IConfigurationChangeEvent
):
void
{
if
(
e
.
affectsConfiguration
(
'
explorer.openEditors.visible
'
))
{
this
.
updateOpenEditorsVisibility
();
}
}
private
updateOpenEditorsVisibility
():
void
{
this
.
openEditorsVisibleContextKey
.
set
(
this
.
workspaceContextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
||
this
.
configurationService
.
getValue
(
'
explorer.openEditors.visible
'
)
!==
0
);
}
}
export
class
ExplorerViewlet
extends
PersistentViewsViewlet
implements
IExplorerViewlet
{
...
...
@@ -177,10 +159,6 @@ export class ExplorerViewlet extends PersistentViewsViewlet implements IExplorer
DOM
.
addClass
(
el
,
'
explorer-viewlet
'
);
}
private
isOpenEditorsVisible
():
boolean
{
return
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
||
this
.
configurationService
.
getValue
(
'
explorer.openEditors.visible
'
)
!==
0
;
}
protected
createView
(
viewDescriptor
:
IViewDescriptor
,
options
:
IViewletViewOptions
):
ViewsViewletPanel
{
if
(
viewDescriptor
.
id
===
ExplorerView
.
ID
)
{
// Create a delegating editor service for the explorer to be able to delay the refresh in the opened
...
...
@@ -253,13 +231,4 @@ export class ExplorerViewlet extends PersistentViewsViewlet implements IExplorer
public
getViewletState
():
FileViewletState
{
return
this
.
viewletState
;
}
protected
loadViewsStates
():
void
{
super
.
loadViewsStates
();
// Remove the open editors view state if it is removed globally
if
(
!
this
.
isOpenEditorsVisible
())
{
this
.
viewsStates
.
delete
(
OpenEditorsView
.
ID
);
}
}
}
\ No newline at end of file
}
src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts
浏览文件 @
4ac4a062
...
...
@@ -396,7 +396,7 @@ export class OpenEditorsView extends ViewsViewletPanel {
}
private
computeMinExpandedBodySize
(
visibleOpenEditors
=
OpenEditorsView
.
DEFAULT_VISIBLE_OPEN_EDITORS
):
number
{
const
itemsToShow
=
Math
.
min
(
Math
.
max
(
visibleOpenEditors
,
1
),
this
.
elementCount
);
const
itemsToShow
=
Math
.
min
(
Math
.
max
(
visibleOpenEditors
,
0
),
this
.
elementCount
);
return
itemsToShow
*
OpenEditorsDelegate
.
ITEM_HEIGHT
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录