Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9b1a541b
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,发现更多精彩内容 >>
提交
9b1a541b
编写于
2月 15, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
notifications - better keyboard support
上级
9a3b1b4a
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
33 addition
and
19 deletion
+33
-19
src/vs/base/browser/ui/button/button.css
src/vs/base/browser/ui/button/button.css
+0
-7
src/vs/base/browser/ui/button/button.ts
src/vs/base/browser/ui/button/button.ts
+18
-4
src/vs/workbench/browser/parts/editor/media/editorstatus.css
src/vs/workbench/browser/parts/editor/media/editorstatus.css
+0
-2
src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css
...browser/parts/notifications/media/notificationsCenter.css
+2
-0
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
...kbench/browser/parts/notifications/notificationsCenter.ts
+2
-2
src/vs/workbench/browser/parts/notifications/notificationsViewer.ts
...kbench/browser/parts/notifications/notificationsViewer.ts
+11
-4
未找到文件。
src/vs/base/browser/ui/button/button.css
浏览文件 @
9b1a541b
...
...
@@ -21,10 +21,3 @@
opacity
:
0.4
;
cursor
:
default
;
}
\ No newline at end of file
/* Theming support */
.vs
.monaco-text-button
:focus
,
.vs-dark
.monaco-text-button
:focus
{
outline-color
:
rgba
(
255
,
255
,
255
,
.5
);
/* buttons have a blue color, so focus indication needs to be different */
}
\ No newline at end of file
src/vs/base/browser/ui/button/button.ts
浏览文件 @
9b1a541b
...
...
@@ -43,6 +43,8 @@ export class Button {
private
_onDidClick
=
new
Emitter
<
any
>
();
readonly
onDidClick
:
Event
<
any
>
=
this
.
_onDidClick
.
event
;
private
focusTracker
:
DOM
.
IFocusTracker
;
constructor
(
container
:
Builder
,
options
?:
IButtonOptions
);
constructor
(
container
:
HTMLElement
,
options
?:
IButtonOptions
);
constructor
(
container
:
any
,
options
?:
IButtonOptions
)
{
...
...
@@ -86,10 +88,7 @@ export class Button {
this
.
$el
.
on
(
DOM
.
EventType
.
MOUSE_OVER
,
(
e
)
=>
{
if
(
!
this
.
$el
.
hasClass
(
'
disabled
'
))
{
const
hoverBackground
=
this
.
buttonHoverBackground
?
this
.
buttonHoverBackground
.
toString
()
:
null
;
if
(
hoverBackground
)
{
this
.
$el
.
style
(
'
background-color
'
,
hoverBackground
);
}
this
.
setHoverBackground
();
}
});
...
...
@@ -97,9 +96,21 @@ export class Button {
this
.
applyStyles
();
// restore standard styles
});
// Also set hover background when button is focused for feedback
const
tracker
=
DOM
.
trackFocus
(
this
.
$el
.
getHTMLElement
());
tracker
.
onDidFocus
(()
=>
this
.
setHoverBackground
());
tracker
.
onDidBlur
(()
=>
this
.
applyStyles
());
// restore standard styles
this
.
applyStyles
();
}
private
setHoverBackground
():
void
{
const
hoverBackground
=
this
.
buttonHoverBackground
?
this
.
buttonHoverBackground
.
toString
()
:
null
;
if
(
hoverBackground
)
{
this
.
$el
.
style
(
'
background-color
'
,
hoverBackground
);
}
}
style
(
styles
:
IButtonStyles
):
void
{
this
.
buttonForeground
=
styles
.
buttonForeground
;
this
.
buttonBackground
=
styles
.
buttonBackground
;
...
...
@@ -165,6 +176,9 @@ export class Button {
if
(
this
.
$el
)
{
this
.
$el
.
dispose
();
this
.
$el
=
null
;
this
.
focusTracker
.
dispose
();
this
.
focusTracker
=
null
;
}
this
.
_onDidClick
.
dispose
();
...
...
src/vs/workbench/browser/parts/editor/media/editorstatus.css
浏览文件 @
9b1a541b
...
...
@@ -35,7 +35,6 @@
position
:
absolute
;
top
:
0
;
right
:
0
;
margin
:
.5em
0
0
;
padding
:
.5em
;
width
:
22px
;
height
:
22px
;
...
...
@@ -67,7 +66,6 @@
padding-left
:
12px
;
padding-right
:
12px
;
border
:
4px
solid
#007ACC
;
border-radius
:
4px
;
float
:
left
;
margin-right
:
5px
;
}
...
...
src/vs/workbench/browser/parts/notifications/media/notificationsCenter.css
浏览文件 @
9b1a541b
...
...
@@ -27,6 +27,7 @@
.monaco-workbench
>
.notifications-list-container
.notification-list-item
{
display
:
flex
;
flex-direction
:
column
;
flex-direction
:
column-reverse
;
/* the details row appears first in order for better keyboard access to notification buttons */
padding
:
10px
5px
;
height
:
100%
;
box-sizing
:
border-box
;
...
...
@@ -82,6 +83,7 @@
}
.monaco-workbench
>
.notifications-list-container
.notification-list-item
:hover
.notification-list-item-toolbar-container
,
.monaco-workbench
>
.notifications-list-container
.monaco-list-row.focused
.notification-list-item
.notification-list-item-toolbar-container
,
.monaco-workbench
>
.notifications-list-container
.notification-list-item.expanded
.notification-list-item-toolbar-container
{
display
:
block
;
}
...
...
src/vs/workbench/browser/parts/notifications/notificationsCenter.ts
浏览文件 @
9b1a541b
...
...
@@ -198,8 +198,8 @@ export class NotificationsCenter extends Themable {
this
.
hide
();
}
// Otherwise restore focus
else
{
// Otherwise restore focus
if we had
else
if
(
typeof
focusedIndex
===
'
number
'
)
{
let
indexToFocus
=
0
;
if
(
focusedItem
)
{
let
indexToFocusCandidate
=
this
.
viewModel
.
indexOf
(
focusedItem
);
...
...
src/vs/workbench/browser/parts/notifications/notificationsViewer.ts
浏览文件 @
9b1a541b
...
...
@@ -225,15 +225,17 @@ export class NotificationRenderer implements IRenderer<INotificationViewItem, IN
container
.
appendChild
(
data
.
container
);
// the details row appears first in order for better keyboard access to notification buttons
data
.
container
.
appendChild
(
data
.
detailsRow
);
data
.
detailsRow
.
appendChild
(
data
.
source
);
data
.
detailsRow
.
appendChild
(
data
.
actionsContainer
);
// main row
data
.
container
.
appendChild
(
data
.
mainRow
);
data
.
mainRow
.
appendChild
(
data
.
icon
);
data
.
mainRow
.
appendChild
(
data
.
message
);
data
.
mainRow
.
appendChild
(
toolbarContainer
);
data
.
container
.
appendChild
(
data
.
detailsRow
);
data
.
detailsRow
.
appendChild
(
data
.
source
);
data
.
detailsRow
.
appendChild
(
data
.
actionsContainer
);
return
data
;
}
...
...
@@ -263,6 +265,11 @@ export class NotificationRenderer implements IRenderer<INotificationViewItem, IN
clearNode
(
data
.
message
);
data
.
message
.
appendChild
(
NotificationMessageMarkdownRenderer
.
render
(
notification
.
message
,
(
content
:
string
)
=>
this
.
openerService
.
open
(
URI
.
parse
(
content
)).
then
(
void
0
,
onUnexpectedError
)));
const
links
=
data
.
message
.
querySelectorAll
(
'
a
'
);
for
(
let
i
=
0
;
i
<
links
.
length
;
i
++
)
{
links
.
item
(
i
).
tabIndex
=
-
1
;
// prevent keyboard navigation to links to allow for better keyboard support within a message
}
// Actions
const
actions
:
IAction
[]
=
[];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录