Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bfc24734
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,发现更多精彩内容 >>
未验证
提交
bfc24734
编写于
2月 17, 2020
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove ViewPane.actionRunner
上级
fd7ea40b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
7 addition
and
33 deletion
+7
-33
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
+1
-16
src/vs/workbench/contrib/files/browser/media/explorerviewlet.css
...workbench/contrib/files/browser/media/explorerviewlet.css
+0
-11
src/vs/workbench/contrib/files/browser/views/emptyView.ts
src/vs/workbench/contrib/files/browser/views/emptyView.ts
+3
-4
src/vs/workbench/contrib/search/browser/searchView.ts
src/vs/workbench/contrib/search/browser/searchView.ts
+3
-2
未找到文件。
src/vs/workbench/browser/parts/views/viewPaneContainer.ts
浏览文件 @
bfc24734
...
...
@@ -12,7 +12,7 @@ import { SIDE_BAR_DRAG_AND_DROP_BACKGROUND, SIDE_BAR_SECTION_HEADER_FOREGROUND,
import
{
append
,
$
,
trackFocus
,
toggleClass
,
EventType
,
isAncestor
,
Dimension
,
addDisposableListener
,
removeClass
,
addClass
}
from
'
vs/base/browser/dom
'
;
import
{
IDisposable
,
combinedDisposable
,
dispose
,
toDisposable
,
Disposable
,
DisposableStore
}
from
'
vs/base/common/lifecycle
'
;
import
{
firstIndex
}
from
'
vs/base/common/arrays
'
;
import
{
IAction
,
IActionRunner
,
ActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IActionViewItem
,
ActionsOrientation
,
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
prepareActions
}
from
'
vs/workbench/browser/actions
'
;
...
...
@@ -51,7 +51,6 @@ export interface IPaneColors extends IColorMapping {
}
export
interface
IViewPaneOptions
extends
IPaneOptions
{
actionRunner
?:
IActionRunner
;
id
:
string
;
title
:
string
;
showActionsAlways
?:
boolean
;
...
...
@@ -169,7 +168,6 @@ export abstract class ViewPane extends Pane implements IView {
private
readonly
menuActions
:
ViewMenuActions
;
protected
actionRunner
?:
IActionRunner
;
private
toolbar
?:
ToolBar
;
private
readonly
showActionsAlways
:
boolean
=
false
;
private
headerContainer
?:
HTMLElement
;
...
...
@@ -196,7 +194,6 @@ export abstract class ViewPane extends Pane implements IView {
this
.
id
=
options
.
id
;
this
.
title
=
options
.
title
;
this
.
actionRunner
=
options
.
actionRunner
;
this
.
showActionsAlways
=
!!
options
.
showActionsAlways
;
this
.
focusedViewContextKey
=
FocusedViewContext
.
bindTo
(
contextKeyService
);
...
...
@@ -262,7 +259,6 @@ export abstract class ViewPane extends Pane implements IView {
actionViewItemProvider
:
action
=>
this
.
getActionViewItem
(
action
),
ariaLabel
:
nls
.
localize
(
'
viewToolbarAriaLabel
'
,
"
{0} actions
"
,
this
.
title
),
getKeyBinding
:
action
=>
this
.
keybindingService
.
lookupKeybinding
(
action
.
id
),
actionRunner
:
this
.
actionRunner
});
this
.
_register
(
this
.
toolbar
);
...
...
@@ -453,8 +449,6 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
private
didLayout
=
false
;
private
dimension
:
Dimension
|
undefined
;
protected
actionRunner
:
IActionRunner
|
undefined
;
private
readonly
visibleViewsCountFromCache
:
number
|
undefined
;
private
readonly
visibleViewsStorageId
:
string
;
protected
readonly
viewsModel
:
PersistentContributableViewsModel
;
...
...
@@ -800,7 +794,6 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
{
id
:
viewDescriptor
.
id
,
title
:
viewDescriptor
.
name
,
actionRunner
:
this
.
getActionRunner
(),
expanded
:
!
collapsed
,
minimumBodySize
:
this
.
viewDescriptorService
.
getViewContainerLocation
(
this
.
viewContainer
)
===
ViewContainerLocation
.
Panel
?
0
:
120
});
...
...
@@ -831,14 +824,6 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
return
panes
;
}
getActionRunner
():
IActionRunner
{
if
(
!
this
.
actionRunner
)
{
this
.
actionRunner
=
new
ActionRunner
();
}
return
this
.
actionRunner
;
}
private
onDidRemoveViewDescriptors
(
removed
:
IViewDescriptorRef
[]):
void
{
removed
=
removed
.
sort
((
a
,
b
)
=>
b
.
index
-
a
.
index
);
const
panesToRemove
:
ViewPane
[]
=
[];
...
...
src/vs/workbench/contrib/files/browser/media/explorerviewlet.css
浏览文件 @
bfc24734
...
...
@@ -67,17 +67,6 @@
border-radius
:
0
;
/* goes better when ellipsis shows up on narrow sidebar */
}
.explorer-viewlet
.explorer-empty-view
{
padding
:
0
20px
0
20px
;
}
.explorer-viewlet
.explorer-empty-view
.monaco-button
{
max-width
:
260px
;
margin-left
:
auto
;
margin-right
:
auto
;
display
:
block
;
}
.explorer-viewlet
.explorer-item.nonexistent-root
{
opacity
:
0.5
;
}
...
...
src/vs/workbench/contrib/files/browser/views/emptyView.ts
浏览文件 @
bfc24734
...
...
@@ -27,6 +27,7 @@ import { isWeb } from 'vs/base/common/platform';
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IViewDescriptorService
}
from
'
vs/workbench/common/views
'
;
import
{
IOpenerService
}
from
'
vs/platform/opener/common/opener
'
;
import
{
ActionRunner
}
from
'
vs/base/common/actions
'
;
export
class
EmptyView
extends
ViewPane
{
...
...
@@ -71,14 +72,12 @@ export class EmptyView extends ViewPane {
this
.
button
=
new
Button
(
messageContainer
);
attachButtonStyler
(
this
.
button
,
this
.
themeService
);
const
actionRunner
=
new
ActionRunner
();
this
.
_register
(
this
.
button
.
onDidClick
(()
=>
{
if
(
!
this
.
actionRunner
)
{
return
;
}
const
action
=
this
.
contextService
.
getWorkbenchState
()
===
WorkbenchState
.
WORKSPACE
?
this
.
instantiationService
.
createInstance
(
AddRootFolderAction
,
AddRootFolderAction
.
ID
,
AddRootFolderAction
.
LABEL
)
:
this
.
instantiationService
.
createInstance
(
OpenFolderAction
,
OpenFolderAction
.
ID
,
OpenFolderAction
.
LABEL
);
this
.
actionRunner
.
run
(
action
).
then
(()
=>
{
actionRunner
.
run
(
action
).
then
(()
=>
{
action
.
dispose
();
},
err
=>
{
action
.
dispose
();
...
...
src/vs/workbench/contrib/search/browser/searchView.ts
浏览文件 @
bfc24734
...
...
@@ -9,7 +9,7 @@ import * as aria from 'vs/base/browser/ui/aria/aria';
import
{
MessageType
}
from
'
vs/base/browser/ui/inputbox/inputBox
'
;
import
{
IIdentityProvider
}
from
'
vs/base/browser/ui/list/list
'
;
import
{
ITreeContextMenuEvent
,
ITreeElement
}
from
'
vs/base/browser/ui/tree/tree
'
;
import
{
IAction
}
from
'
vs/base/common/actions
'
;
import
{
IAction
,
ActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
Delayer
}
from
'
vs/base/common/async
'
;
import
*
as
errors
from
'
vs/base/common/errors
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
...
...
@@ -1584,6 +1584,7 @@ export class SearchView extends ViewPane {
const
openFolderLink
=
dom
.
append
(
textEl
,
$
(
'
a.pointer.prominent
'
,
{
tabindex
:
0
},
nls
.
localize
(
'
openFolder
'
,
"
Open Folder
"
)));
const
actionRunner
=
new
ActionRunner
();
this
.
messageDisposables
.
push
(
dom
.
addDisposableListener
(
openFolderLink
,
dom
.
EventType
.
CLICK
,
(
e
:
MouseEvent
)
=>
{
dom
.
EventHelper
.
stop
(
e
,
false
);
...
...
@@ -1591,7 +1592,7 @@ export class SearchView extends ViewPane {
this
.
instantiationService
.
createInstance
(
OpenFileFolderAction
,
OpenFileFolderAction
.
ID
,
OpenFileFolderAction
.
LABEL
)
:
this
.
instantiationService
.
createInstance
(
OpenFolderAction
,
OpenFolderAction
.
ID
,
OpenFolderAction
.
LABEL
);
this
.
actionRunner
!
.
run
(
action
).
then
(()
=>
{
actionRunner
.
run
(
action
).
then
(()
=>
{
action
.
dispose
();
},
err
=>
{
action
.
dispose
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录