Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
32a18e3f
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 搜索 >>
提交
32a18e3f
编写于
11月 26, 2020
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add Codicon.dropDownButton
上级
20b64972
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
6 deletion
+9
-6
src/vs/base/browser/ui/button/button.ts
src/vs/base/browser/ui/button/button.ts
+2
-5
src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts
src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts
+2
-1
src/vs/base/common/codicons.ts
src/vs/base/common/codicons.ts
+5
-0
未找到文件。
src/vs/base/browser/ui/button/button.ts
浏览文件 @
32a18e3f
...
...
@@ -15,8 +15,7 @@ import { renderCodicons } from 'vs/base/browser/codicons';
import
{
addDisposableListener
,
IFocusTracker
,
EventType
,
EventHelper
,
trackFocus
,
reset
,
removeTabIndexAndUpdateFocus
}
from
'
vs/base/browser/dom
'
;
import
{
IContextMenuProvider
}
from
'
vs/base/browser/contextmenu
'
;
import
{
IAction
,
IActionRunner
}
from
'
vs/base/common/actions
'
;
import
{
Codicon
,
CSSIcon
,
registerIcon
}
from
'
vs/base/common/codicons
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
CSSIcon
,
Codicon
}
from
'
vs/base/common/codicons
'
;
export
interface
IButtonOptions
extends
IButtonStyles
{
readonly
title
?:
boolean
|
string
;
...
...
@@ -238,8 +237,6 @@ export interface IButtonWithDropdownOptions extends IButtonOptions {
readonly
actionRunner
?:
IActionRunner
;
}
const
dropdownIcon
=
registerIcon
(
'
button-drow-down
'
,
Codicon
.
chevronDown
,
localize
(
'
dropdownIcon
'
,
'
Icon for button with dropdowns
'
));
export
class
ButtonWithDropdown
extends
Disposable
implements
IButton
{
private
readonly
button
:
Button
;
...
...
@@ -260,7 +257,7 @@ export class ButtonWithDropdown extends Disposable implements IButton {
this
.
dropdownButton
=
this
.
_register
(
new
Button
(
this
.
element
,
{
...
options
,
title
:
false
,
supportCodicons
:
true
}));
this
.
dropdownButton
.
element
.
classList
.
add
(
'
monaco-dropdown-button
'
);
this
.
dropdownButton
.
icon
=
dropdownIc
on
;
this
.
dropdownButton
.
icon
=
Codicon
.
dropDownButt
on
;
this
.
_register
(
this
.
dropdownButton
.
onDidClick
(()
=>
{
options
.
contextMenuProvider
.
showContextMenu
({
getAnchor
:
()
=>
this
.
dropdownButton
.
element
,
...
...
src/vs/base/browser/ui/dropdown/dropdownActionViewItem.ts
浏览文件 @
32a18e3f
...
...
@@ -13,6 +13,7 @@ import { Emitter } from 'vs/base/common/event';
import
{
ActionViewItem
,
BaseActionViewItem
,
IActionViewItemOptions
,
IBaseActionViewItemOptions
}
from
'
vs/base/browser/ui/actionbar/actionViewItems
'
;
import
{
IActionProvider
,
DropdownMenu
,
IDropdownMenuOptions
,
ILabelRenderer
}
from
'
vs/base/browser/ui/dropdown/dropdown
'
;
import
{
IContextMenuProvider
}
from
'
vs/base/browser/contextmenu
'
;
import
{
Codicon
}
from
'
vs/base/common/codicons
'
;
export
interface
IKeybindingProvider
{
(
action
:
IAction
):
ResolvedKeybinding
|
undefined
;
...
...
@@ -169,7 +170,7 @@ export class ActionWithDropdownActionViewItem extends ActionViewItem {
super
.
render
(
container
);
if
(
this
.
element
)
{
this
.
element
.
classList
.
add
(
'
action-dropdown-item
'
);
this
.
dropdownMenuActionViewItem
=
new
DropdownMenuActionViewItem
(
new
Action
(
'
dropdownAction
'
,
undefined
),
(
<
IActionWithDropdownActionViewItemOptions
>
this
.
options
).
menuActionsOrProvider
,
this
.
contextMenuProvider
,
{
classNames
:
[
'
dropdown
'
,
'
codicon-chevron-down
'
,
...(
<
IActionWithDropdownActionViewItemOptions
>
this
.
options
).
menuActionClassNames
||
[]]
});
this
.
dropdownMenuActionViewItem
=
new
DropdownMenuActionViewItem
(
new
Action
(
'
dropdownAction
'
,
undefined
),
(
<
IActionWithDropdownActionViewItemOptions
>
this
.
options
).
menuActionsOrProvider
,
this
.
contextMenuProvider
,
{
classNames
:
[
'
dropdown
'
,
...
Codicon
.
dropDownButton
.
classNamesArray
,
...(
<
IActionWithDropdownActionViewItemOptions
>
this
.
options
).
menuActionClassNames
||
[]]
});
this
.
dropdownMenuActionViewItem
.
render
(
this
.
element
);
}
}
...
...
src/vs/base/common/codicons.ts
浏览文件 @
32a18e3f
...
...
@@ -5,6 +5,7 @@
import
{
codiconStartMarker
}
from
'
vs/base/common/codicon
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
localize
}
from
'
vs/nls
'
;
export
interface
IIconRegistry
{
readonly
all
:
IterableIterator
<
Codicon
>
;
...
...
@@ -496,8 +497,12 @@ export namespace Codicon {
export
const
passFilled
=
new
Codicon
(
'
pass-filled
'
,
{
character
:
'
\\
ebb3
'
});
export
const
circleLargeFilled
=
new
Codicon
(
'
circle-large-filled
'
,
{
character
:
'
\\
ebb4
'
});
export
const
circleLargeOutline
=
new
Codicon
(
'
circle-large-outline
'
,
{
character
:
'
\\
ebb5
'
});
export
const
dropDownButton
=
new
Codicon
(
'
drop-down-button
'
,
Codicon
.
chevronDown
.
definition
);
}
// common icons
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录