Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8a806778
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,发现更多精彩内容 >>
提交
8a806778
编写于
10月 16, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix #49465
上级
a97e8c31
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
23 addition
and
30 deletion
+23
-30
src/vs/base/browser/contextmenu.ts
src/vs/base/browser/contextmenu.ts
+1
-0
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+0
-1
src/vs/base/common/actions.ts
src/vs/base/common/actions.ts
+0
-18
src/vs/workbench/browser/parts/compositeBar.ts
src/vs/workbench/browser/parts/compositeBar.ts
+6
-5
src/vs/workbench/browser/parts/compositeBarActions.ts
src/vs/workbench/browser/parts/compositeBarActions.ts
+4
-3
src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts
...rvices/contextmenu/electron-browser/contextmenuService.ts
+12
-3
未找到文件。
src/vs/base/browser/contextmenu.ts
浏览文件 @
8a806778
...
...
@@ -25,6 +25,7 @@ export class ContextSubMenu extends SubmenuAction {
export
interface
IContextMenuDelegate
{
getAnchor
():
HTMLElement
|
{
x
:
number
;
y
:
number
;
width
?:
number
;
height
?:
number
;
};
getActions
():
ReadonlyArray
<
IAction
|
ContextSubMenu
>
;
getCheckedActionsRepresentation
?(
action
:
IAction
):
'
radio
'
|
'
checkbox
'
;
getActionViewItem
?(
action
:
IAction
):
IActionViewItem
|
undefined
;
getActionsContext
?(
event
?:
IContextMenuEvent
):
any
;
getKeyBinding
?(
action
:
IAction
):
ResolvedKeybinding
|
undefined
;
...
...
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
8a806778
...
...
@@ -224,7 +224,6 @@ export class Separator extends Action {
constructor
(
label
?:
string
)
{
super
(
Separator
.
ID
,
label
,
label
?
'
separator text
'
:
'
separator
'
);
this
.
checked
=
false
;
this
.
radio
=
false
;
this
.
enabled
=
false
;
}
}
...
...
src/vs/base/common/actions.ts
浏览文件 @
8a806778
...
...
@@ -29,7 +29,6 @@ export interface IAction extends IDisposable {
class
:
string
|
undefined
;
enabled
:
boolean
;
checked
:
boolean
;
radio
:
boolean
;
run
(
event
?:
any
):
Promise
<
any
>
;
}
...
...
@@ -54,7 +53,6 @@ export interface IActionChangeEvent {
readonly
class
?:
string
;
readonly
enabled
?:
boolean
;
readonly
checked
?:
boolean
;
readonly
radio
?:
boolean
;
}
export
class
Action
extends
Disposable
implements
IAction
{
...
...
@@ -68,7 +66,6 @@ export class Action extends Disposable implements IAction {
protected
_cssClass
:
string
|
undefined
;
protected
_enabled
:
boolean
=
true
;
protected
_checked
:
boolean
=
false
;
protected
_radio
:
boolean
=
false
;
protected
readonly
_actionCallback
?:
(
event
?:
any
)
=>
Promise
<
any
>
;
constructor
(
id
:
string
,
label
:
string
=
''
,
cssClass
:
string
=
''
,
enabled
:
boolean
=
true
,
actionCallback
?:
(
event
?:
any
)
=>
Promise
<
any
>
)
{
...
...
@@ -152,14 +149,6 @@ export class Action extends Disposable implements IAction {
this
.
_setChecked
(
value
);
}
get
radio
():
boolean
{
return
this
.
_radio
;
}
set
radio
(
value
:
boolean
)
{
this
.
_setRadio
(
value
);
}
protected
_setChecked
(
value
:
boolean
):
void
{
if
(
this
.
_checked
!==
value
)
{
this
.
_checked
=
value
;
...
...
@@ -167,13 +156,6 @@ export class Action extends Disposable implements IAction {
}
}
protected
_setRadio
(
value
:
boolean
):
void
{
if
(
this
.
_radio
!==
value
)
{
this
.
_radio
=
value
;
this
.
_onDidChange
.
fire
({
radio
:
value
});
}
}
run
(
event
?:
any
,
_data
?:
ITelemetryData
):
Promise
<
any
>
{
if
(
this
.
_actionCallback
)
{
return
this
.
_actionCallback
(
event
);
...
...
src/vs/workbench/browser/parts/compositeBar.ts
浏览文件 @
8a806778
...
...
@@ -30,11 +30,12 @@ export interface ICompositeBarItem {
}
export
interface
ICompositeBarOptions
{
icon
:
boolean
;
orientation
:
ActionsOrientation
;
colors
:
(
theme
:
ITheme
)
=>
ICompositeBarColors
;
compositeSize
:
number
;
overflowActionSize
:
number
;
readonly
icon
:
boolean
;
readonly
orientation
:
ActionsOrientation
;
readonly
colors
:
(
theme
:
ITheme
)
=>
ICompositeBarColors
;
readonly
compositeSize
:
number
;
readonly
overflowActionSize
:
number
;
getActivityAction
:
(
compositeId
:
string
)
=>
ActivityAction
;
getCompositePinnedAction
:
(
compositeId
:
string
)
=>
Action
;
getOnCompositeClickAction
:
(
compositeId
:
string
)
=>
Action
;
...
...
src/vs/workbench/browser/parts/compositeBarActions.ts
浏览文件 @
8a806778
...
...
@@ -383,6 +383,7 @@ export class CompositeOverflowActivityActionViewItem extends ActivityActionViewI
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
this
.
container
,
getActions
:
()
=>
this
.
actions
,
getCheckedActionsRepresentation
:
()
=>
'
radio
'
,
onHide
:
()
=>
dispose
(
this
.
actions
)
});
}
...
...
@@ -390,7 +391,7 @@ export class CompositeOverflowActivityActionViewItem extends ActivityActionViewI
private
getActions
():
Action
[]
{
return
this
.
getOverflowingComposites
().
map
(
composite
=>
{
const
action
=
this
.
getCompositeOpenAction
(
composite
.
id
);
action
.
radio
=
this
.
getActiveCompositeId
()
===
action
.
id
;
action
.
checked
=
this
.
getActiveCompositeId
()
===
action
.
id
;
const
badge
=
this
.
getBadge
(
composite
.
id
);
let
suffix
:
string
|
number
|
undefined
;
...
...
@@ -614,8 +615,8 @@ export class CompositeActionViewItem extends ActivityActionViewItem {
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
anchor
,
getActions
Context
:
()
=>
this
.
activity
.
id
,
getActions
:
()
=>
actions
getActions
:
()
=>
actions
,
getActions
Context
:
()
=>
this
.
activity
.
id
});
}
...
...
src/vs/workbench/services/contextmenu/electron-browser/contextmenuService.ts
浏览文件 @
8a806778
...
...
@@ -138,10 +138,19 @@ class NativeContextMenuService extends Disposable implements IContextMenuService
// Normal Menu Item
else
{
let
type
:
'
radio
'
|
'
checkbox
'
|
undefined
=
undefined
;
if
(
!!
entry
.
checked
)
{
if
(
typeof
delegate
.
getCheckedActionsRepresentation
===
'
function
'
)
{
type
=
delegate
.
getCheckedActionsRepresentation
(
entry
);
}
else
{
type
=
'
checkbox
'
;
}
}
const
item
:
IContextMenuItem
=
{
label
:
unmnemonicLabel
(
entry
.
label
),
checked
:
!!
entry
.
checked
||
!!
entry
.
radio
,
type
:
!!
entry
.
checked
?
'
checkbox
'
:
!!
entry
.
radio
?
'
radio
'
:
undefined
,
checked
:
!!
entry
.
checked
,
type
,
enabled
:
!!
entry
.
enabled
,
click
:
event
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录