Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b99fad3a
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,发现更多精彩内容 >>
提交
b99fad3a
编写于
6月 08, 2018
作者:
S
SteVen Batten
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more fixes from merge
上级
703ba640
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
73 addition
and
12 deletion
+73
-12
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+26
-4
src/vs/base/browser/ui/menu/menu.ts
src/vs/base/browser/ui/menu/menu.ts
+6
-2
src/vs/code/electron-main/menubar.ts
src/vs/code/electron-main/menubar.ts
+0
-2
src/vs/workbench/browser/layout.ts
src/vs/workbench/browser/layout.ts
+3
-3
src/vs/workbench/browser/parts/menubar/media/menubarpart.css
src/vs/workbench/browser/parts/menubar/media/menubarpart.css
+0
-1
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+15
-0
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+23
-0
未找到文件。
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
b99fad3a
...
...
@@ -17,7 +17,7 @@ import * as DOM from 'vs/base/browser/dom';
import
*
as
types
from
'
vs/base/common/types
'
;
import
{
EventType
,
Gesture
}
from
'
vs/base/browser/touch
'
;
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
KeyCode
,
KeyMod
,
KeyCodeUtils
}
from
'
vs/base/common/keyCodes
'
;
import
{
IContextViewProvider
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
...
...
@@ -43,6 +43,8 @@ export class BaseActionItem implements IActionItem {
public
_context
:
any
;
public
_action
:
IAction
;
static
MNEMONIC_REGEX
:
RegExp
=
/&&
(
.
)
/g
;
private
_actionRunner
:
IActionRunner
;
constructor
(
context
:
any
,
action
:
IAction
,
protected
options
?:
IBaseActionItemOptions
)
{
...
...
@@ -167,12 +169,14 @@ export class BaseActionItem implements IActionItem {
public
focus
():
void
{
if
(
this
.
builder
)
{
this
.
builder
.
domFocus
();
this
.
builder
.
addClass
(
'
focused
'
);
}
}
public
blur
():
void
{
if
(
this
.
builder
)
{
this
.
builder
.
domBlur
();
this
.
builder
.
removeClass
(
'
focused
'
);
}
}
...
...
@@ -273,7 +277,9 @@ export class ActionItem extends BaseActionItem {
public
_updateLabel
():
void
{
if
(
this
.
options
.
label
)
{
this
.
$e
.
text
(
this
.
getAction
().
label
);
let
label
=
this
.
getAction
().
label
;
label
=
label
.
replace
(
BaseActionItem
.
MNEMONIC_REGEX
,
'
<u>$1</u>
'
);
this
.
$e
.
innerHtml
(
label
);
}
}
...
...
@@ -372,6 +378,9 @@ export class ActionBar implements IActionRunner {
// Items
public
items
:
IActionItem
[];
private
mnemonics
:
{
[
index
:
number
]:
IAction
;
}
=
{};
private
focusedItem
:
number
;
private
focusTracker
:
DOM
.
IFocusTracker
;
...
...
@@ -446,6 +455,8 @@ export class ActionBar implements IActionRunner {
this
.
focusNext
();
}
else
if
(
event
.
equals
(
KeyCode
.
Escape
))
{
this
.
cancel
();
}
else
if
(
this
.
mnemonics
[
event
.
keyCode
])
{
this
.
run
(
this
.
mnemonics
[
event
.
keyCode
]);
}
else
if
(
event
.
equals
(
KeyCode
.
Enter
)
||
event
.
equals
(
KeyCode
.
Space
))
{
// Nothing, just staying out of the else branch
}
else
{
...
...
@@ -487,7 +498,7 @@ export class ActionBar implements IActionRunner {
this
.
actionsList
=
document
.
createElement
(
'
ul
'
);
this
.
actionsList
.
className
=
'
actions-container
'
;
if
(
this
.
options
.
isMenu
)
{
this
.
actionsList
.
setAttribute
(
'
role
'
,
'
menu
bar
'
);
this
.
actionsList
.
setAttribute
(
'
role
'
,
'
menu
'
);
}
else
{
this
.
actionsList
.
setAttribute
(
'
role
'
,
'
toolbar
'
);
}
...
...
@@ -558,6 +569,15 @@ export class ActionBar implements IActionRunner {
return
this
.
domNode
;
}
private
_addMnemonic
(
action
:
IAction
):
void
{
let
matches
=
BaseActionItem
.
MNEMONIC_REGEX
.
exec
(
action
.
label
);
if
(
matches
&&
matches
.
length
===
2
)
{
let
mnemonic
=
matches
[
1
];
this
.
mnemonics
[
KeyCodeUtils
.
fromString
(
mnemonic
)]
=
action
;
}
}
public
push
(
arg
:
IAction
|
IAction
[],
options
:
IActionOptions
=
{}):
void
{
const
actions
:
IAction
[]
=
!
Array
.
isArray
(
arg
)
?
[
arg
]
:
arg
;
...
...
@@ -575,6 +595,8 @@ export class ActionBar implements IActionRunner {
e
.
stopPropagation
();
});
this
.
_addMnemonic
(
action
);
let
item
:
IActionItem
=
null
;
if
(
this
.
options
.
actionItemProvider
)
{
...
...
@@ -808,4 +830,4 @@ export class SelectActionItem extends BaseActionItem {
super
.
dispose
();
}
}
}
\ No newline at end of file
src/vs/base/browser/ui/menu/menu.ts
浏览文件 @
b99fad3a
...
...
@@ -18,6 +18,7 @@ export interface IMenuOptions {
actionItemProvider
?:
IActionItemProvider
;
actionRunner
?:
IActionRunner
;
getKeyBinding
?:
(
action
:
IAction
)
=>
ResolvedKeybinding
;
ariaLabel
?:
string
;
}
export
class
Menu
{
...
...
@@ -27,9 +28,11 @@ export class Menu {
constructor
(
container
:
HTMLElement
,
actions
:
IAction
[],
options
:
IMenuOptions
=
{})
{
addClass
(
container
,
'
monaco-menu-container
'
);
container
.
setAttribute
(
'
role
'
,
'
presentation
'
);
let
menuContainer
=
document
.
createElement
(
'
div
'
);
addClass
(
menuContainer
,
'
monaco-menu
'
);
menuContainer
.
setAttribute
(
'
role
'
,
'
presentation
'
);
container
.
appendChild
(
menuContainer
);
this
.
actionBar
=
new
ActionBar
(
menuContainer
,
{
...
...
@@ -37,10 +40,11 @@ export class Menu {
actionItemProvider
:
options
.
actionItemProvider
,
context
:
options
.
context
,
actionRunner
:
options
.
actionRunner
,
isMenu
:
true
isMenu
:
true
,
ariaLabel
:
options
.
ariaLabel
});
this
.
actionBar
.
push
(
actions
,
{
icon
:
true
,
label
:
true
});
this
.
actionBar
.
push
(
actions
,
{
icon
:
true
,
label
:
true
,
isMenu
:
true
});
}
public
get
onDidCancel
():
Event
<
void
>
{
...
...
src/vs/code/electron-main/menubar.ts
浏览文件 @
b99fad3a
...
...
@@ -56,7 +56,6 @@ export class Menubar {
private
nativeTabMenuItems
:
Electron
.
MenuItem
[];
private
menubarMenus
:
IMenubarData
=
{};
private
menubarWindowId
:
number
;
constructor
(
@
IUpdateService
private
updateService
:
IUpdateService
,
...
...
@@ -136,7 +135,6 @@ export class Menubar {
updateMenu
(
menus
:
IMenubarData
,
windowId
:
number
)
{
this
.
menubarMenus
=
menus
;
this
.
menubarWindowId
=
windowId
;
this
.
scheduleUpdateMenu
();
}
...
...
src/vs/workbench/browser/layout.ts
浏览文件 @
b99fad3a
...
...
@@ -104,9 +104,9 @@ export class WorkbenchLayout extends Disposable implements IVerticalSashLayoutPr
this
.
restorePreviousState
();
// Create layout sashes
this
.
sashXOne
=
new
Sash
(
this
.
workbenchContainer
,
this
,
{
baseSize
:
5
}
);
this
.
sashXTwo
=
new
Sash
(
this
.
workbenchContainer
,
this
,
{
baseSize
:
5
}
);
this
.
sashY
=
new
Sash
(
this
.
workbenchContainer
,
this
,
{
baseSize
:
4
,
orientation
:
Orientation
.
HORIZONTAL
});
this
.
sashXOne
=
new
Sash
(
this
.
workbenchContainer
,
this
);
this
.
sashXTwo
=
new
Sash
(
this
.
workbenchContainer
,
this
);
this
.
sashY
=
new
Sash
(
this
.
workbenchContainer
,
this
,
{
orientation
:
Orientation
.
HORIZONTAL
});
this
.
onMaximizeChange
(
false
);
...
...
src/vs/workbench/browser/parts/menubar/media/menubarpart.css
浏览文件 @
b99fad3a
...
...
@@ -42,7 +42,6 @@
}
.menubar-menu-items-holder
{
/* display: none; */
position
:
absolute
;
left
:
0px
;
opacity
:
1
;
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
b99fad3a
...
...
@@ -1084,6 +1084,21 @@ export class Workbench extends Disposable implements IPartService {
// Notifications Alerts
this
.
_register
(
this
.
instantiationService
.
createInstance
(
NotificationsAlerts
,
this
.
notificationService
.
model
));
// Notifications Status
const
notificationsStatus
=
this
.
instantiationService
.
createInstance
(
NotificationsStatus
,
this
.
notificationService
.
model
);
// Eventing
this
.
_register
(
this
.
notificationsCenter
.
onDidChangeVisibility
(()
=>
{
// Update status
notificationsStatus
.
update
(
this
.
notificationsCenter
.
isVisible
);
// Update toasts
this
.
notificationsToasts
.
update
(
this
.
notificationsCenter
.
isVisible
);
// Register commands
registerNotificationCommands
(
this
.
notificationsCenter
,
this
.
notificationsToasts
);
}));
}
private
_onTitleBarVisibilityChange
:
Emitter
<
void
>
=
new
Emitter
<
void
>
();
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
b99fad3a
...
...
@@ -958,11 +958,16 @@ export class TestWindowService implements IWindowService {
public
_serviceBrand
:
any
;
onDidChangeFocus
:
Event
<
boolean
>
=
new
Emitter
<
boolean
>
().
event
;
onDidChangeMaximize
:
Event
<
boolean
>
;
isFocused
():
TPromise
<
boolean
>
{
return
TPromise
.
as
(
false
);
}
isMaximized
():
TPromise
<
boolean
>
{
return
TPromise
.
as
(
false
);
}
getConfiguration
():
IWindowConfiguration
{
return
Object
.
create
(
null
);
}
...
...
@@ -1027,6 +1032,18 @@ export class TestWindowService implements IWindowService {
return
TPromise
.
as
(
void
0
);
}
maximizeWindow
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
unmaximizeWindow
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
minimizeWindow
():
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
openWindow
(
paths
:
string
[],
options
?:
{
forceNewWindow
?:
boolean
,
forceReuseWindow
?:
boolean
,
forceOpenWorkspaceAsFile
?:
boolean
}):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
@@ -1104,6 +1121,8 @@ export class TestWindowsService implements IWindowsService {
onWindowOpen
:
Event
<
number
>
;
onWindowFocus
:
Event
<
number
>
;
onWindowBlur
:
Event
<
number
>
;
onWindowMaximize
:
Event
<
number
>
;
onWindowUnmaximize
:
Event
<
number
>
;
isFocused
(
windowId
:
number
):
TPromise
<
boolean
>
{
return
TPromise
.
as
(
false
);
...
...
@@ -1189,6 +1208,10 @@ export class TestWindowsService implements IWindowsService {
return
TPromise
.
as
(
void
0
);
}
minimizeWindow
(
windowId
:
number
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
unmaximizeWindow
(
windowId
:
number
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录