Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
79acca17
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,发现更多精彩内容 >>
未验证
提交
79acca17
编写于
7月 25, 2018
作者:
S
SteVen Batten
提交者:
GitHub
7月 25, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updating menu behavior for when to select first entry (#54953)
上级
7c59c2f9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
14 deletion
+16
-14
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+2
-0
src/vs/base/browser/ui/menu/menu.ts
src/vs/base/browser/ui/menu/menu.ts
+8
-8
src/vs/platform/contextview/browser/contextMenuHandler.ts
src/vs/platform/contextview/browser/contextMenuHandler.ts
+1
-1
src/vs/workbench/browser/parts/menubar/menubarPart.ts
src/vs/workbench/browser/parts/menubar/menubarPart.ts
+5
-5
未找到文件。
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
79acca17
...
...
@@ -408,6 +408,8 @@ export class ActionBar implements IActionRunner {
this
.
domNode
=
document
.
createElement
(
'
div
'
);
this
.
domNode
.
className
=
'
monaco-action-bar
'
;
this
.
domNode
.
tabIndex
=
0
;
if
(
options
.
animated
!==
false
)
{
DOM
.
addClass
(
this
.
domNode
,
'
animated
'
);
}
...
...
src/vs/base/browser/ui/menu/menu.ts
浏览文件 @
79acca17
...
...
@@ -93,9 +93,9 @@ export class Menu {
return
this
.
actionBar
.
onDidBlur
;
}
public
focus
()
{
public
focus
(
selectFirst
=
true
)
{
if
(
this
.
actionBar
)
{
this
.
actionBar
.
focus
(
true
);
this
.
actionBar
.
focus
(
selectFirst
);
}
}
...
...
@@ -256,7 +256,7 @@ class SubmenuActionItem extends MenuActionItem {
this
.
showScheduler
=
new
RunOnceScheduler
(()
=>
{
if
(
this
.
mouseOver
)
{
this
.
cleanupExistingSubmenu
(
false
);
this
.
createSubmenu
();
this
.
createSubmenu
(
false
);
}
},
250
);
...
...
@@ -280,7 +280,7 @@ class SubmenuActionItem extends MenuActionItem {
if
(
event
.
equals
(
KeyCode
.
RightArrow
))
{
EventHelper
.
stop
(
e
,
true
);
this
.
createSubmenu
();
this
.
createSubmenu
(
true
);
}
});
...
...
@@ -310,7 +310,7 @@ class SubmenuActionItem extends MenuActionItem {
// stop clicking from trying to run an action
EventHelper
.
stop
(
e
,
true
);
this
.
createSubmenu
();
this
.
createSubmenu
(
false
);
}
private
cleanupExistingSubmenu
(
force
:
boolean
)
{
...
...
@@ -325,7 +325,7 @@ class SubmenuActionItem extends MenuActionItem {
}
}
private
createSubmenu
()
{
private
createSubmenu
(
selectFirstItem
=
true
)
{
if
(
!
this
.
parentData
.
submenu
)
{
this
.
submenuContainer
=
$
(
this
.
builder
).
div
({
class
:
'
monaco-submenu menubar-menu-items-holder context-view
'
});
...
...
@@ -356,11 +356,11 @@ class SubmenuActionItem extends MenuActionItem {
this
.
parentData
.
submenu
=
new
Menu
(
this
.
submenuContainer
.
getHTMLElement
(),
this
.
submenuActions
,
this
.
submenuOptions
);
this
.
parentData
.
submenu
.
focus
();
this
.
parentData
.
submenu
.
focus
(
selectFirstItem
);
this
.
mysubmenu
=
this
.
parentData
.
submenu
;
}
else
{
this
.
parentData
.
submenu
.
focus
();
this
.
parentData
.
submenu
.
focus
(
false
);
}
}
...
...
src/vs/platform/contextview/browser/contextMenuHandler.ts
浏览文件 @
79acca17
...
...
@@ -82,7 +82,7 @@ export class ContextMenuHandler {
menu
.
onDidCancel
(()
=>
this
.
contextViewService
.
hideContextView
(
true
),
null
,
menuDisposables
);
menu
.
onDidBlur
(()
=>
this
.
contextViewService
.
hideContextView
(
true
),
null
,
menuDisposables
);
menu
.
focus
();
menu
.
focus
(
!!
delegate
.
autoSelectFirstItem
);
return
combinedDisposable
([...
menuDisposables
,
menu
]);
},
...
...
src/vs/workbench/browser/parts/menubar/menubarPart.ts
浏览文件 @
79acca17
...
...
@@ -298,7 +298,7 @@ export class MenubarPart extends Part {
}
if
(
this
.
focusedMenu
)
{
this
.
showCustomMenu
(
this
.
focusedMenu
.
index
);
this
.
showCustomMenu
(
this
.
focusedMenu
.
index
,
!!
this
.
_modifierKeyStatus
&&
this
.
_modifierKeyStatus
.
altKey
);
}
break
;
}
...
...
@@ -664,7 +664,7 @@ export class MenubarPart extends Part {
this
.
setUnfocusedState
();
}
else
{
this
.
cleanupCustomMenu
();
this
.
showCustomMenu
(
menuIndex
);
this
.
showCustomMenu
(
menuIndex
,
!!
this
.
_modifierKeyStatus
&&
this
.
_modifierKeyStatus
.
altKey
);
}
}
else
{
this
.
focusedMenu
=
{
index
:
menuIndex
};
...
...
@@ -679,7 +679,7 @@ export class MenubarPart extends Part {
if
(
this
.
isOpen
&&
!
this
.
isCurrentMenu
(
menuIndex
))
{
this
.
customMenus
[
menuIndex
].
buttonElement
.
domFocus
();
this
.
cleanupCustomMenu
();
this
.
showCustomMenu
(
menuIndex
);
this
.
showCustomMenu
(
menuIndex
,
false
);
}
else
if
(
this
.
isFocused
&&
!
this
.
isOpen
)
{
this
.
focusedMenu
=
{
index
:
menuIndex
};
this
.
customMenus
[
menuIndex
].
buttonElement
.
domFocus
();
...
...
@@ -881,7 +881,7 @@ export class MenubarPart extends Part {
}
}
private
showCustomMenu
(
menuIndex
:
number
):
void
{
private
showCustomMenu
(
menuIndex
:
number
,
selectFirst
=
true
):
void
{
const
customMenu
=
this
.
customMenus
[
menuIndex
];
let
menuHolder
=
$
(
customMenu
.
buttonElement
).
div
({
class
:
'
menubar-menu-items-holder
'
});
...
...
@@ -911,7 +911,7 @@ export class MenubarPart extends Part {
},
100
);
}));
menuWidget
.
focus
();
menuWidget
.
focus
(
selectFirst
);
this
.
focusedMenu
=
{
index
:
menuIndex
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录