Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
43e23215
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,发现更多精彩内容 >>
未验证
提交
43e23215
编写于
8月 14, 2018
作者:
S
SteVen Batten
提交者:
GitHub
8月 14, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes issues with menubar in fullscreen (#56414)
上级
ffa66057
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
11 deletion
+57
-11
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
+22
-10
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
+5
-0
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+30
-1
未找到文件。
src/vs/workbench/browser/parts/titlebar/menubarControl.ts
浏览文件 @
43e23215
...
...
@@ -229,17 +229,23 @@ export class MenubarControl extends Disposable {
return
;
}
const
isVisible
=
this
.
isVisible
;
const
isOpen
=
this
.
isOpen
;
const
isFocused
=
this
.
isFocused
;
this
.
_focusState
=
value
;
switch
(
value
)
{
case
MenubarState
.
HIDDEN
:
if
(
this
.
isVisible
)
{
if
(
isVisible
)
{
this
.
hideMenubar
();
}
if
(
this
.
isOpen
)
{
if
(
isOpen
)
{
this
.
cleanupCustomMenu
();
}
if
(
this
.
isFocused
)
{
if
(
isFocused
)
{
this
.
focusedMenu
=
null
;
if
(
this
.
focusToReturn
)
{
...
...
@@ -251,15 +257,15 @@ export class MenubarControl extends Disposable {
break
;
case
MenubarState
.
VISIBLE
:
if
(
!
this
.
isVisible
)
{
if
(
!
isVisible
)
{
this
.
showMenubar
();
}
if
(
this
.
isOpen
)
{
if
(
isOpen
)
{
this
.
cleanupCustomMenu
();
}
if
(
this
.
isFocused
)
{
if
(
isFocused
)
{
if
(
this
.
focusedMenu
)
{
this
.
customMenus
[
this
.
focusedMenu
.
index
].
buttonElement
.
blur
();
}
...
...
@@ -274,11 +280,11 @@ export class MenubarControl extends Disposable {
break
;
case
MenubarState
.
FOCUSED
:
if
(
!
this
.
isVisible
)
{
if
(
!
isVisible
)
{
this
.
showMenubar
();
}
if
(
this
.
isOpen
)
{
if
(
isOpen
)
{
this
.
cleanupCustomMenu
();
}
...
...
@@ -287,7 +293,7 @@ export class MenubarControl extends Disposable {
}
break
;
case
MenubarState
.
OPEN
:
if
(
!
this
.
isVisible
)
{
if
(
!
isVisible
)
{
this
.
showMenubar
();
}
...
...
@@ -338,7 +344,13 @@ export class MenubarControl extends Disposable {
}
private
setUnfocusedState
():
void
{
this
.
focusState
=
this
.
currentMenubarVisibility
===
'
toggle
'
||
this
.
currentMenubarVisibility
===
'
hidden
'
?
MenubarState
.
HIDDEN
:
MenubarState
.
VISIBLE
;
if
(
this
.
currentMenubarVisibility
===
'
toggle
'
||
this
.
currentMenubarVisibility
===
'
hidden
'
)
{
this
.
focusState
=
MenubarState
.
HIDDEN
;
}
else
if
(
this
.
currentMenubarVisibility
===
'
default
'
&&
browser
.
isFullscreen
())
{
this
.
focusState
=
MenubarState
.
HIDDEN
;
}
else
{
this
.
focusState
=
MenubarState
.
VISIBLE
;
}
}
private
hideMenubar
():
void
{
...
...
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
浏览文件 @
43e23215
...
...
@@ -35,6 +35,7 @@ import { MenubarControl } from 'vs/workbench/browser/parts/titlebar/menubarContr
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
template
,
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
IUriDisplayService
}
from
'
vs/platform/uriDisplay/common/uriDisplay
'
;
import
{
Event
}
from
'
vs/base/common/event
'
;
export
class
TitlebarPart
extends
Part
implements
ITitleService
{
...
...
@@ -134,6 +135,10 @@ export class TitlebarPart extends Part implements ITitleService {
}
}
onMenubarVisibilityChange
():
Event
<
boolean
>
{
return
this
.
menubarPart
.
onVisibilityChange
;
}
private
onActiveEditorChange
():
void
{
// Dispose old listeners
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
43e23215
...
...
@@ -219,6 +219,7 @@ export class Workbench extends Disposable implements IPartService {
private
sideBarHidden
:
boolean
;
private
statusBarHidden
:
boolean
;
private
activityBarHidden
:
boolean
;
private
menubarToggled
:
boolean
;
private
sideBarPosition
:
Position
;
private
panelPosition
:
Position
;
private
panelHidden
:
boolean
;
...
...
@@ -532,6 +533,16 @@ export class Workbench extends Disposable implements IPartService {
}
}
private
onMenubarToggled
(
visible
:
boolean
)
{
if
(
visible
!==
this
.
menubarToggled
)
{
this
.
menubarToggled
=
visible
;
if
(
this
.
menubarVisibility
===
'
toggle
'
||
(
browser
.
isFullscreen
()
&&
this
.
menubarVisibility
===
'
default
'
))
{
this
.
layout
();
}
}
}
private
onEditorClosed
(
listenerDispose
:
IDisposable
,
resourcesToWaitFor
:
URI
[],
waitMarkerFile
:
URI
):
void
{
// In wait mode, listen to changes to the editors and wait until the files
...
...
@@ -1004,6 +1015,12 @@ export class Workbench extends Disposable implements IPartService {
// Notification Handlers
this
.
createNotificationsHandlers
();
// Menubar visibility changes
if
((
isWindows
||
isLinux
)
&&
this
.
getCustomTitleBarStyle
()
===
'
custom
'
)
{
this
.
titlebarPart
.
onMenubarVisibilityChange
()(
e
=>
this
.
onMenubarToggled
(
e
));
}
// Add Workbench to DOM
this
.
container
.
appendChild
(
this
.
workbench
);
}
...
...
@@ -1160,7 +1177,19 @@ export class Workbench extends Disposable implements IPartService {
isVisible
(
part
:
Parts
):
boolean
{
switch
(
part
)
{
case
Parts
.
TITLEBAR_PART
:
return
this
.
getCustomTitleBarStyle
()
===
'
custom
'
&&
(
!
browser
.
isFullscreen
()
||
this
.
menubarVisibility
===
'
visible
'
||
this
.
menubarVisibility
===
'
toggle
'
);
if
(
this
.
getCustomTitleBarStyle
()
!==
'
custom
'
)
{
return
false
;
}
else
if
(
!
browser
.
isFullscreen
())
{
return
true
;
}
else
if
(
isMacintosh
)
{
return
false
;
}
else
if
(
this
.
menubarVisibility
===
'
visible
'
)
{
return
true
;
}
else
if
(
this
.
menubarVisibility
===
'
toggle
'
||
this
.
menubarVisibility
===
'
default
'
)
{
return
this
.
menubarToggled
;
}
return
false
;
case
Parts
.
SIDEBAR_PART
:
return
!
this
.
sideBarHidden
;
case
Parts
.
PANEL_PART
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录