Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9849693b
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,发现更多精彩内容 >>
提交
9849693b
编写于
9月 11, 2018
作者:
S
SteVen Batten
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #53479
上级
15facaa9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
7 deletion
+25
-7
src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
...s/workbench/browser/parts/titlebar/media/titlebarpart.css
+5
-0
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
+9
-7
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+11
-0
未找到文件。
src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css
浏览文件 @
9849693b
...
@@ -51,6 +51,11 @@
...
@@ -51,6 +51,11 @@
overflow
:
visible
;
overflow
:
visible
;
}
}
.monaco-workbench.windows
>
.part.titlebar
>
.window-title
,
.monaco-workbench.linux
>
.part.titlebar
>
.window-title
{
cursor
:
default
;
}
.monaco-workbench.linux
>
.part.titlebar
>
.window-title
{
.monaco-workbench.linux
>
.part.titlebar
>
.window-title
{
font-size
:
inherit
;
font-size
:
inherit
;
}
}
...
...
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
浏览文件 @
9849693b
...
@@ -112,6 +112,7 @@ export class MenubarControl extends Disposable {
...
@@ -112,6 +112,7 @@ export class MenubarControl extends Disposable {
private
mnemonics
:
Map
<
KeyCode
,
number
>
;
private
mnemonics
:
Map
<
KeyCode
,
number
>
;
private
_onVisibilityChange
:
Emitter
<
boolean
>
;
private
_onVisibilityChange
:
Emitter
<
boolean
>
;
private
_onFocusStateChange
:
Emitter
<
boolean
>
;
private
static
MAX_MENU_RECENT_ENTRIES
=
10
;
private
static
MAX_MENU_RECENT_ENTRIES
=
10
;
...
@@ -152,6 +153,7 @@ export class MenubarControl extends Disposable {
...
@@ -152,6 +153,7 @@ export class MenubarControl extends Disposable {
}));
}));
this
.
_onVisibilityChange
=
this
.
_register
(
new
Emitter
<
boolean
>
());
this
.
_onVisibilityChange
=
this
.
_register
(
new
Emitter
<
boolean
>
());
this
.
_onFocusStateChange
=
this
.
_register
(
new
Emitter
<
boolean
>
());
if
(
isMacintosh
||
this
.
currentTitlebarStyleSetting
!==
'
custom
'
)
{
if
(
isMacintosh
||
this
.
currentTitlebarStyleSetting
!==
'
custom
'
)
{
for
(
let
topLevelMenuName
of
Object
.
keys
(
this
.
topLevelMenus
))
{
for
(
let
topLevelMenuName
of
Object
.
keys
(
this
.
topLevelMenus
))
{
...
@@ -305,6 +307,7 @@ export class MenubarControl extends Disposable {
...
@@ -305,6 +307,7 @@ export class MenubarControl extends Disposable {
}
}
this
.
_focusState
=
value
;
this
.
_focusState
=
value
;
this
.
_onFocusStateChange
.
fire
(
this
.
focusState
>=
MenubarState
.
FOCUSED
);
}
}
private
get
mnemonicsInUse
():
boolean
{
private
get
mnemonicsInUse
():
boolean
{
...
@@ -793,11 +796,6 @@ export class MenubarControl extends Disposable {
...
@@ -793,11 +796,6 @@ export class MenubarControl extends Disposable {
e
.
stopPropagation
();
e
.
stopPropagation
();
}));
}));
this
.
_register
(
DOM
.
addDisposableListener
(
this
.
customMenus
[
menuIndex
].
buttonElement
,
DOM
.
EventType
.
CLICK
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
stopPropagation
();
}));
this
.
_register
(
DOM
.
addDisposableListener
(
this
.
customMenus
[
menuIndex
].
buttonElement
,
DOM
.
EventType
.
MOUSE_ENTER
,
()
=>
{
this
.
_register
(
DOM
.
addDisposableListener
(
this
.
customMenus
[
menuIndex
].
buttonElement
,
DOM
.
EventType
.
MOUSE_ENTER
,
()
=>
{
if
(
this
.
isOpen
&&
!
this
.
isCurrentMenu
(
menuIndex
))
{
if
(
this
.
isOpen
&&
!
this
.
isCurrentMenu
(
menuIndex
))
{
this
.
customMenus
[
menuIndex
].
buttonElement
.
focus
();
this
.
customMenus
[
menuIndex
].
buttonElement
.
focus
();
...
@@ -836,8 +834,8 @@ export class MenubarControl extends Disposable {
...
@@ -836,8 +834,8 @@ export class MenubarControl extends Disposable {
}
}
}));
}));
this
.
_register
(
DOM
.
addDisposableListener
(
window
,
DOM
.
EventType
.
CLICK
,
()
=>
{
this
.
_register
(
DOM
.
addDisposableListener
(
window
,
DOM
.
EventType
.
MOUSE_DOWN
,
()
=>
{
// This
click
is outside the menubar so it counts as a focus out
// This
mouse event
is outside the menubar so it counts as a focus out
if
(
this
.
isFocused
)
{
if
(
this
.
isFocused
)
{
this
.
setUnfocusedState
();
this
.
setUnfocusedState
();
}
}
...
@@ -1105,6 +1103,10 @@ export class MenubarControl extends Disposable {
...
@@ -1105,6 +1103,10 @@ export class MenubarControl extends Disposable {
return
this
.
_onVisibilityChange
.
event
;
return
this
.
_onVisibilityChange
.
event
;
}
}
public
get
onFocusStateChange
():
Event
<
boolean
>
{
return
this
.
_onFocusStateChange
.
event
;
}
public
layout
(
dimension
:
DOM
.
Dimension
)
{
public
layout
(
dimension
:
DOM
.
Dimension
)
{
if
(
this
.
container
)
{
if
(
this
.
container
)
{
this
.
container
.
style
.
height
=
`
${
dimension
.
height
}
px`
;
this
.
container
.
style
.
height
=
`
${
dimension
.
height
}
px`
;
...
...
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
浏览文件 @
9849693b
...
@@ -134,6 +134,16 @@ export class TitlebarPart extends Part implements ITitleService {
...
@@ -134,6 +134,16 @@ export class TitlebarPart extends Part implements ITitleService {
}
}
}
}
private
onMenubarFocusChanged
(
focused
:
boolean
)
{
if
(
isWindows
||
isLinux
)
{
if
(
focused
)
{
hide
(
this
.
dragRegion
);
}
else
{
show
(
this
.
dragRegion
);
}
}
}
onMenubarVisibilityChange
():
Event
<
boolean
>
{
onMenubarVisibilityChange
():
Event
<
boolean
>
{
return
this
.
menubarPart
.
onVisibilityChange
;
return
this
.
menubarPart
.
onVisibilityChange
;
}
}
...
@@ -285,6 +295,7 @@ export class TitlebarPart extends Part implements ITitleService {
...
@@ -285,6 +295,7 @@ export class TitlebarPart extends Part implements ITitleService {
if
(
!
isMacintosh
)
{
if
(
!
isMacintosh
)
{
this
.
_register
(
this
.
menubarPart
.
onVisibilityChange
(
e
=>
this
.
onMenubarVisibilityChanged
(
e
)));
this
.
_register
(
this
.
menubarPart
.
onVisibilityChange
(
e
=>
this
.
onMenubarVisibilityChanged
(
e
)));
this
.
_register
(
this
.
menubarPart
.
onFocusStateChange
(
e
=>
this
.
onMenubarFocusChanged
(
e
)));
}
}
// Title
// Title
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录