Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
80fc8b85
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
80fc8b85
编写于
1月 23, 2016
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweaks for keyboard accessibility
上级
1132f27e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
46 addition
and
87 deletion
+46
-87
src/vs/base/browser/ui/actionbar/actionbar.ts
src/vs/base/browser/ui/actionbar/actionbar.ts
+5
-0
src/vs/base/browser/ui/messagelist/messageList.ts
src/vs/base/browser/ui/messagelist/messageList.ts
+10
-1
src/vs/workbench/browser/parts/activitybar/media/activityaction.css
...kbench/browser/parts/activitybar/media/activityaction.css
+0
-56
src/vs/workbench/browser/viewlet.ts
src/vs/workbench/browser/viewlet.ts
+16
-15
src/vs/workbench/electron-browser/media/shell.css
src/vs/workbench/electron-browser/media/shell.css
+13
-13
src/vs/workbench/parts/files/browser/views/explorerViewer.ts
src/vs/workbench/parts/files/browser/views/explorerViewer.ts
+1
-1
src/vs/workbench/parts/git/browser/views/changes/changesView.ts
.../workbench/parts/git/browser/views/changes/changesView.ts
+1
-1
未找到文件。
src/vs/base/browser/ui/actionbar/actionbar.ts
浏览文件 @
80fc8b85
...
...
@@ -10,6 +10,7 @@ import nls = require('vs/nls');
import
lifecycle
=
require
(
'
vs/base/common/lifecycle
'
);
import
{
Promise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
platform
=
require
(
'
vs/base/common/platform
'
);
import
{
IAction
,
IActionRunner
,
Action
,
ActionRunner
}
from
'
vs/base/common/actions
'
;
import
DOM
=
require
(
'
vs/base/browser/dom
'
);
import
{
EventType
as
CommonEventType
}
from
'
vs/base/common/events
'
;
...
...
@@ -115,6 +116,10 @@ export class BaseActionItem extends EventEmitter implements IActionItem {
this
.
builder
.
on
(
DOM
.
EventType
.
CLICK
,
(
event
:
Event
)
=>
{
this
.
onClick
(
event
);
});
this
.
builder
.
on
(
EventType
.
Tap
,
e
=>
{
this
.
onClick
(
e
);
});
if
(
platform
.
isMacintosh
)
{
this
.
builder
.
on
(
DOM
.
EventType
.
CONTEXT_MENU
,
(
event
:
Event
)
=>
{
this
.
onClick
(
event
);
});
// https://github.com/Microsoft/vscode/issues/1011
}
this
.
builder
.
on
(
'
mousedown
'
,
(
e
:
MouseEvent
)
=>
{
if
(
e
.
button
===
0
&&
this
.
_action
.
enabled
)
{
this
.
builder
.
addClass
(
'
active
'
);
...
...
src/vs/base/browser/ui/messagelist/messageList.ts
浏览文件 @
80fc8b85
...
...
@@ -15,6 +15,8 @@ import types = require('vs/base/common/types');
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
htmlRenderer
=
require
(
'
vs/base/browser/htmlContentRenderer
'
);
import
{
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
CommonKeybindings
}
from
'
vs/base/common/keyCodes
'
;
export
enum
Severity
{
Info
,
...
...
@@ -197,7 +199,14 @@ export class MessageList {
messageActions
.
forEach
((
action
)
=>
{
let
clazz
=
(
total
>
1
||
delta
<
0
)
?
'
message-right-side multiple
'
:
'
message-right-side
'
;
li
.
div
({
class
:
clazz
},
(
div
)
=>
{
div
.
a
({
class
:
'
action-button
'
}).
text
(
action
.
label
).
on
(
'
click
'
,
(
e
)
=>
{
div
.
a
({
class
:
'
action-button
'
,
tabindex
:
'
0
'
}).
text
(
action
.
label
).
on
([
DOM
.
EventType
.
CLICK
,
DOM
.
EventType
.
KEY_DOWN
],
(
e
)
=>
{
if
(
e
instanceof
KeyboardEvent
)
{
let
event
=
new
StandardKeyboardEvent
(
e
);
if
(
!
event
.
equals
(
CommonKeybindings
.
ENTER
)
&&
!
event
.
equals
(
CommonKeybindings
.
SPACE
))
{
return
;
// Only handle Enter/Escape for keyboard access
}
}
DOM
.
EventHelper
.
stop
(
e
,
true
);
if
(
this
.
usageLogger
)
{
...
...
src/vs/workbench/browser/parts/activitybar/media/activityaction.css
浏览文件 @
80fc8b85
...
...
@@ -79,14 +79,6 @@
text-decoration
:
none
;
}
.monaco-workbench
>
.activitybar
>
.content
.monaco-action-bar
.action-item.active
{
-ms-transform
:
none
;
-webkit-transform
:
none
;
-moz-transform
:
none
;
-o-transform
:
none
;
transform
:
none
;
}
.monaco-workbench
>
.activitybar
>
.content
.monaco-action-bar
.badge
{
position
:
absolute
;
top
:
0
;
...
...
@@ -115,54 +107,6 @@
opacity
:
1
;
}
.monaco-workbench.vs
>
.activitybar.left
>
.content
>
.monaco-action-bar.position-top
.action-label.active
:after
{
content
:
''
;
position
:
absolute
;
top
:
15px
;
right
:
0
;
width
:
0
;
height
:
0
;
border-top
:
5px
solid
transparent
;
border-bottom
:
5px
solid
transparent
;
border-right
:
5px
solid
#F6F6F6
;
}
.monaco-workbench.vs-dark
>
.activitybar.left
>
.content
>
.monaco-action-bar.position-top
.action-label.active
:after
{
content
:
''
;
position
:
absolute
;
top
:
15px
;
right
:
0
;
width
:
0
;
height
:
0
;
border-top
:
5px
solid
transparent
;
border-bottom
:
5px
solid
transparent
;
border-right
:
5px
solid
#252526
;
}
.monaco-workbench.vs
>
.activitybar.right
>
.content
>
.monaco-action-bar.position-top
.action-label.active
:before
{
content
:
''
;
position
:
absolute
;
top
:
15px
;
left
:
0
;
width
:
0
;
height
:
0
;
border-top
:
5px
solid
transparent
;
border-bottom
:
5px
solid
transparent
;
border-left
:
5px
solid
#F6F6F6
;
}
.monaco-workbench.vs-dark
>
.activitybar.right
>
.content
>
.monaco-action-bar.position-top
.action-label.active
:before
{
content
:
''
;
position
:
absolute
;
top
:
15px
;
left
:
0
;
width
:
0
;
height
:
0
;
border-top
:
5px
solid
transparent
;
border-bottom
:
5px
solid
transparent
;
border-left
:
5px
solid
#252526
;
}
/* Right aligned */
.monaco-workbench
>
.activitybar.right
>
.content
.monaco-action-bar
.action-label
{
...
...
src/vs/workbench/browser/viewlet.ts
浏览文件 @
80fc8b85
...
...
@@ -334,7 +334,7 @@ export class AdaptiveCollapsibleViewletView extends FixedCollapsibleView impleme
}
protected
changeState
(
state
:
CollapsibleState
):
void
{
changeState
(
state
,
this
.
tree
);
updateTreeVisibility
(
this
.
tree
,
state
===
CollapsibleState
.
EXPANDED
,
true
/* focus if expanded */
);
super
.
changeState
(
state
);
}
...
...
@@ -354,11 +354,7 @@ export class AdaptiveCollapsibleViewletView extends FixedCollapsibleView impleme
public
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
this
.
isVisible
=
visible
;
if
(
visible
)
{
this
.
tree
.
onVisible
();
}
else
{
this
.
tree
.
onHidden
();
}
updateTreeVisibility
(
this
.
tree
,
this
.
state
===
CollapsibleState
.
EXPANDED
);
return
Promise
.
as
(
null
);
}
...
...
@@ -441,7 +437,7 @@ export class CollapsibleViewletView extends CollapsibleView implements IViewletV
}
protected
changeState
(
state
:
CollapsibleState
):
void
{
changeState
(
state
,
this
.
tree
);
updateTreeVisibility
(
this
.
tree
,
state
===
CollapsibleState
.
EXPANDED
,
true
/* focus if expanded */
);
super
.
changeState
(
state
);
}
...
...
@@ -483,11 +479,7 @@ export class CollapsibleViewletView extends CollapsibleView implements IViewletV
public
setVisible
(
visible
:
boolean
):
TPromise
<
void
>
{
this
.
isVisible
=
visible
;
if
(
visible
)
{
this
.
tree
.
onVisible
();
}
else
{
this
.
tree
.
onHidden
();
}
updateTreeVisibility
(
this
.
tree
,
this
.
state
===
CollapsibleState
.
EXPANDED
);
return
Promise
.
as
(
null
);
}
...
...
@@ -550,17 +542,26 @@ function renderViewTree(container: HTMLElement): HTMLElement {
return
treeContainer
;
}
function
changeState
(
state
:
CollapsibleState
,
tree
:
ITree
):
void
{
function
updateTreeVisibility
(
tree
:
ITree
,
isVisible
:
boolean
,
focusIfVisible
?:
boolean
):
void
{
if
(
!
tree
)
{
return
;
}
if
(
state
==
CollapsibleState
.
EXPANDED
)
{
if
(
isVisible
)
{
$
(
tree
.
getHTMLElement
()).
show
();
tree
.
DOMFocus
();
// make the tree have focus once a view gets expanded
}
else
{
$
(
tree
.
getHTMLElement
()).
hide
();
// make sure the tree goes out of the tabindex world by hiding it
}
if
(
focusIfVisible
&&
isVisible
)
{
tree
.
DOMFocus
();
}
if
(
isVisible
)
{
tree
.
onVisible
();
}
else
{
tree
.
onHidden
();
}
}
function
focus
(
tree
:
ITree
):
void
{
...
...
src/vs/workbench/electron-browser/media/shell.css
浏览文件 @
80fc8b85
...
...
@@ -78,28 +78,24 @@
outline-offset
:
-2px
;
}
.monaco-shell.vs
.monaco-tree.focused
.monaco-tree-rows
:empty
,
.monaco-shell.vs
.monaco-tree.focused.no-item-focus
.monaco-tree-rows
{
.monaco-shell.vs
.monaco-tree.focused
:focus
.monaco-tree-rows
:empty
,
.monaco-shell.vs
.monaco-tree.focused
:focus
.no-item-focus
.monaco-tree-rows
{
outline
:
1px
auto
#1E8AE5
;
/* we still need to handle the empty tree or no focus item case */
outline-offset
:
-
3
px
;
outline-offset
:
-
2
px
;
}
.monaco-shell.vs-dark
.monaco-tree.focused
.monaco-tree-rows
:empty
,
.monaco-shell.vs-dark
.monaco-tree.focused.no-item-focus
.monaco-tree-rows
{
.monaco-shell.vs-dark
.monaco-tree.focused
:focus
.monaco-tree-rows
:empty
,
.monaco-shell.vs-dark
.monaco-tree.focused.no-item-focus
:focus
.monaco-tree-rows
{
outline
:
1px
auto
#1E8AE5
;
/* we still need to handle the empty tree or no focus item case */
outline-offset
:
-
3
px
;
outline-offset
:
-
2
px
;
}
.monaco-shell.hc-black
.monaco-tree.focused
.monaco-tree-rows
:empty
,
.monaco-shell.hc-black
.monaco-tree.focused.no-item-focus
.monaco-tree-rows
{
.monaco-shell.hc-black
.monaco-tree.focused
:focus
.monaco-tree-rows
:empty
,
.monaco-shell.hc-black
.monaco-tree.focused.no-item-focus
:focus
.monaco-tree-rows
{
outline
:
2px
auto
#DF740C
;
/* we still need to handle the empty tree or no focus item case */
outline-offset
:
-2px
;
}
.monaco-shell
.quick-open-widget
.quick-open-tree
.monaco-tree-rows
{
outline
:
0
!important
;
/* quick open is special because focus is always in the input field */
}
.monaco-shell
input
[
type
=
"text"
],
.monaco-shell
textarea
{
outline
:
0
;
/* do not show outline in input fields and textarea */
}
...
...
@@ -109,7 +105,11 @@
}
.monaco-shell
.activitybar
[
tabindex
=
"0"
]
:focus
{
outline
:
0
!important
;
/* activity bar indicates focus customly */
outline
:
0
;
/* activity bar indicates focus custom */
}
.monaco-shell
.part.editor
.binary-container
:focus
{
outline
:
0
;
/* binary container indicates focus custom */
}
/* END Keyboard Focus Indication Styles */
...
...
src/vs/workbench/parts/files/browser/views/explorerViewer.ts
浏览文件 @
80fc8b85
...
...
@@ -317,7 +317,7 @@ export class FileRenderer extends ActionsRenderer implements Tree.IRenderer {
var
toDispose
=
[
inputBox
,
DOM
.
addStandardDisposableListener
(
inputBox
.
inputElement
,
'
keydown
'
,
(
e
:
DOM
.
IKeyboardEvent
)
=>
{
DOM
.
addStandardDisposableListener
(
inputBox
.
inputElement
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
DOM
.
IKeyboardEvent
)
=>
{
if
(
e
.
equals
(
CommonKeybindings
.
ENTER
))
{
if
(
inputBox
.
validate
()
&&
!
disposed
)
{
commit
();
...
...
src/vs/workbench/parts/git/browser/views/changes/changesView.ts
浏览文件 @
80fc8b85
...
...
@@ -200,7 +200,7 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
this
.
currentDimension
=
dimension
;
this
.
commitInputBox
.
layout
();
var
statusViewHeight
=
dimension
.
height
-
(
this
.
commitInputBox
.
height
+
1
0
/* margin */
);
var
statusViewHeight
=
dimension
.
height
-
(
this
.
commitInputBox
.
height
+
1
2
/* margin */
);
this
.
$statusView
.
size
(
dimension
.
width
,
statusViewHeight
);
this
.
tree
.
layout
(
statusViewHeight
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录