Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2f1809c7
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,发现更多精彩内容 >>
未验证
提交
2f1809c7
编写于
6月 08, 2020
作者:
S
SteVen Batten
提交者:
GitHub
6月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #99448 (#99475)
上级
cee31f32
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
6 deletion
+13
-6
src/vs/base/browser/ui/dropdown/dropdown.ts
src/vs/base/browser/ui/dropdown/dropdown.ts
+11
-5
src/vs/base/browser/ui/toolbar/toolbar.ts
src/vs/base/browser/ui/toolbar/toolbar.ts
+2
-1
未找到文件。
src/vs/base/browser/ui/dropdown/dropdown.ts
浏览文件 @
2f1809c7
...
...
@@ -214,6 +214,7 @@ export interface IDropdownMenuOptions extends IBaseDropdownOptions {
actions
?:
ReadonlyArray
<
IAction
>
;
actionProvider
?:
IActionProvider
;
menuClassName
?:
string
;
menuAsChild
?:
boolean
;
// scope down for #99448
}
export
class
DropdownMenu
extends
BaseDropdown
{
...
...
@@ -222,6 +223,7 @@ export class DropdownMenu extends BaseDropdown {
private
_actions
:
ReadonlyArray
<
IAction
>
=
[];
private
actionProvider
?:
IActionProvider
;
private
menuClassName
:
string
;
private
menuAsChild
?:
boolean
;
constructor
(
container
:
HTMLElement
,
options
:
IDropdownMenuOptions
)
{
super
(
container
,
options
);
...
...
@@ -230,6 +232,7 @@ export class DropdownMenu extends BaseDropdown {
this
.
actions
=
options
.
actions
||
[];
this
.
actionProvider
=
options
.
actionProvider
;
this
.
menuClassName
=
options
.
menuClassName
||
''
;
this
.
menuAsChild
=
!!
options
.
menuAsChild
;
}
set
menuOptions
(
options
:
IMenuOptions
|
undefined
)
{
...
...
@@ -267,7 +270,7 @@ export class DropdownMenu extends BaseDropdown {
onHide
:
()
=>
this
.
onHide
(),
actionRunner
:
this
.
menuOptions
?
this
.
menuOptions
.
actionRunner
:
undefined
,
anchorAlignment
:
this
.
menuOptions
?
this
.
menuOptions
.
anchorAlignment
:
AnchorAlignment
.
LEFT
,
anchorAsContainer
:
t
rue
anchorAsContainer
:
t
his
.
menuAsChild
});
}
...
...
@@ -289,10 +292,11 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
private
keybindings
?:
(
action
:
IAction
)
=>
ResolvedKeybinding
|
undefined
;
private
clazz
:
string
|
undefined
;
private
anchorAlignmentProvider
:
(()
=>
AnchorAlignment
)
|
undefined
;
private
menuAsChild
?:
boolean
;
constructor
(
action
:
IAction
,
menuActions
:
ReadonlyArray
<
IAction
>
,
contextMenuProvider
:
IContextMenuProvider
,
actionViewItemProvider
:
IActionViewItemProvider
|
undefined
,
actionRunner
:
IActionRunner
,
keybindings
:
((
action
:
IAction
)
=>
ResolvedKeybinding
|
undefined
)
|
undefined
,
clazz
:
string
|
undefined
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
);
constructor
(
action
:
IAction
,
actionProvider
:
IActionProvider
,
contextMenuProvider
:
IContextMenuProvider
,
actionViewItemProvider
:
IActionViewItemProvider
|
undefined
,
actionRunner
:
IActionRunner
,
keybindings
:
((
action
:
IAction
)
=>
ResolvedKeybinding
)
|
undefined
,
clazz
:
string
|
undefined
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
);
constructor
(
action
:
IAction
,
menuActionsOrProvider
:
ReadonlyArray
<
IAction
>
|
IActionProvider
,
contextMenuProvider
:
IContextMenuProvider
,
actionViewItemProvider
:
IActionViewItemProvider
|
undefined
,
actionRunner
:
IActionRunner
,
keybindings
:
((
action
:
IAction
)
=>
ResolvedKeybinding
|
undefined
)
|
undefined
,
clazz
:
string
|
undefined
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
)
{
constructor
(
action
:
IAction
,
menuActions
:
ReadonlyArray
<
IAction
>
,
contextMenuProvider
:
IContextMenuProvider
,
actionViewItemProvider
:
IActionViewItemProvider
|
undefined
,
actionRunner
:
IActionRunner
,
keybindings
:
((
action
:
IAction
)
=>
ResolvedKeybinding
|
undefined
)
|
undefined
,
clazz
:
string
|
undefined
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
,
menuAsChild
?:
boolean
);
constructor
(
action
:
IAction
,
actionProvider
:
IActionProvider
,
contextMenuProvider
:
IContextMenuProvider
,
actionViewItemProvider
:
IActionViewItemProvider
|
undefined
,
actionRunner
:
IActionRunner
,
keybindings
:
((
action
:
IAction
)
=>
ResolvedKeybinding
)
|
undefined
,
clazz
:
string
|
undefined
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
,
menuAsChild
?:
boolean
);
constructor
(
action
:
IAction
,
menuActionsOrProvider
:
ReadonlyArray
<
IAction
>
|
IActionProvider
,
contextMenuProvider
:
IContextMenuProvider
,
actionViewItemProvider
:
IActionViewItemProvider
|
undefined
,
actionRunner
:
IActionRunner
,
keybindings
:
((
action
:
IAction
)
=>
ResolvedKeybinding
|
undefined
)
|
undefined
,
clazz
:
string
|
undefined
,
anchorAlignmentProvider
?:
()
=>
AnchorAlignment
,
menuAsChild
?:
boolean
)
{
super
(
null
,
action
);
this
.
menuActionsOrProvider
=
menuActionsOrProvider
;
...
...
@@ -302,6 +306,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
this
.
keybindings
=
keybindings
;
this
.
clazz
=
clazz
;
this
.
anchorAlignmentProvider
=
anchorAlignmentProvider
;
this
.
menuAsChild
=
menuAsChild
;
}
render
(
container
:
HTMLElement
):
void
{
...
...
@@ -322,7 +327,8 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
const
options
:
IDropdownMenuOptions
=
{
contextMenuProvider
:
this
.
contextMenuProvider
,
labelRenderer
:
labelRenderer
labelRenderer
:
labelRenderer
,
menuAsChild
:
this
.
menuAsChild
};
// Render the DropdownMenu around a simple action to toggle it
...
...
src/vs/base/browser/ui/toolbar/toolbar.ts
浏览文件 @
2f1809c7
...
...
@@ -69,7 +69,8 @@ export class ToolBar extends Disposable {
this
.
actionRunner
,
this
.
options
.
getKeyBinding
,
toolBarMoreIcon
.
classNames
,
this
.
options
.
anchorAlignmentProvider
this
.
options
.
anchorAlignmentProvider
,
true
);
this
.
toggleMenuActionViewItem
.
value
.
setActionContext
(
this
.
actionBar
.
context
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录