Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b7a9bfa7
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,发现更多精彩内容 >>
提交
b7a9bfa7
编写于
4月 10, 2020
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add ariaLabel to IStatusbarEntry
fixes #94677
上级
1ec9f9b7
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
59 addition
and
16 deletion
+59
-16
src/vs/workbench/api/browser/mainThreadStatusBar.ts
src/vs/workbench/api/browser/mainThreadStatusBar.ts
+1
-1
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+17
-5
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
...kbench/browser/parts/notifications/notificationsStatus.ts
+2
-1
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
+4
-1
src/vs/workbench/contrib/debug/browser/debugStatus.ts
src/vs/workbench/contrib/debug/browser/debugStatus.ts
+3
-2
src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts
...ib/extensions/electron-browser/extensionProfileService.ts
+1
-0
src/vs/workbench/contrib/feedback/browser/feedbackStatusbarItem.ts
...rkbench/contrib/feedback/browser/feedbackStatusbarItem.ts
+1
-0
src/vs/workbench/contrib/markers/browser/markers.contribution.ts
...workbench/contrib/markers/browser/markers.contribution.ts
+3
-1
src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.ts
...bench/contrib/preferences/browser/keyboardLayoutPicker.ts
+10
-3
src/vs/workbench/contrib/remote/browser/remoteIndicator.ts
src/vs/workbench/contrib/remote/browser/remoteIndicator.ts
+6
-1
src/vs/workbench/contrib/scm/browser/activity.ts
src/vs/workbench/contrib/scm/browser/activity.ts
+4
-1
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
+1
-0
src/vs/workbench/services/progress/browser/progressService.ts
...vs/workbench/services/progress/browser/progressService.ts
+1
-0
src/vs/workbench/services/statusbar/common/statusbar.ts
src/vs/workbench/services/statusbar/common/statusbar.ts
+5
-0
未找到文件。
src/vs/workbench/api/browser/mainThreadStatusBar.ts
浏览文件 @
b7a9bfa7
...
...
@@ -26,7 +26,7 @@ export class MainThreadStatusBar implements MainThreadStatusBarShape {
}
$setEntry
(
id
:
number
,
statusId
:
string
,
statusName
:
string
,
text
:
string
,
tooltip
:
string
|
undefined
,
command
:
Command
|
undefined
,
color
:
string
|
ThemeColor
|
undefined
,
alignment
:
MainThreadStatusBarAlignment
,
priority
:
number
|
undefined
):
void
{
const
entry
:
IStatusbarEntry
=
{
text
,
tooltip
,
command
,
color
};
const
entry
:
IStatusbarEntry
=
{
text
,
tooltip
,
command
,
color
,
ariaLabel
:
text
};
if
(
typeof
priority
===
'
undefined
'
)
{
priority
=
0
;
...
...
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
b7a9bfa7
...
...
@@ -401,8 +401,10 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
private
updateTabFocusModeElement
(
visible
:
boolean
):
void
{
if
(
visible
)
{
if
(
!
this
.
tabFocusModeElement
.
value
)
{
const
text
=
nls
.
localize
(
'
tabFocusModeEnabled
'
,
"
Tab Moves Focus
"
);
this
.
tabFocusModeElement
.
value
=
this
.
statusbarService
.
addEntry
({
text
:
nls
.
localize
(
'
tabFocusModeEnabled
'
,
"
Tab Moves Focus
"
),
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
disableTabMode
'
,
"
Disable Accessibility Mode
"
),
command
:
'
editor.action.toggleTabFocusMode
'
,
backgroundColor
:
themeColorFromId
(
STATUS_BAR_PROMINENT_ITEM_BACKGROUND
),
...
...
@@ -417,8 +419,10 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
private
updateColumnSelectionModeElement
(
visible
:
boolean
):
void
{
if
(
visible
)
{
if
(
!
this
.
columnSelectionModeElement
.
value
)
{
const
text
=
nls
.
localize
(
'
columnSelectionModeEnabled
'
,
"
Column Selection
"
);
this
.
columnSelectionModeElement
.
value
=
this
.
statusbarService
.
addEntry
({
text
:
nls
.
localize
(
'
columnSelectionModeEnabled
'
,
"
Column Selection
"
),
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
disableColumnSelectionMode
'
,
"
Disable Column Selection Mode
"
),
command
:
'
editor.action.toggleColumnSelection
'
,
backgroundColor
:
themeColorFromId
(
STATUS_BAR_PROMINENT_ITEM_BACKGROUND
),
...
...
@@ -433,8 +437,10 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
private
updateScreenReaderModeElement
(
visible
:
boolean
):
void
{
if
(
visible
)
{
if
(
!
this
.
screenRedearModeElement
.
value
)
{
const
text
=
nls
.
localize
(
'
screenReaderDetected
'
,
"
Screen Reader Optimized
"
);
this
.
screenRedearModeElement
.
value
=
this
.
statusbarService
.
addEntry
({
text
:
nls
.
localize
(
'
screenReaderDetected
'
,
"
Screen Reader Optimized
"
),
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
screenReaderDetectedExtra
'
,
"
If you are not using a Screen Reader, please change the setting `editor.accessibilitySupport` to
\"
off
\"
.
"
),
command
:
'
showEditorScreenReaderNotification
'
,
backgroundColor
:
themeColorFromId
(
STATUS_BAR_PROMINENT_ITEM_BACKGROUND
),
...
...
@@ -454,6 +460,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
props
:
IStatusbarEntry
=
{
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
gotoLine
'
,
"
Go to Line/Column
"
),
command
:
'
workbench.action.gotoLine
'
};
...
...
@@ -469,6 +476,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
props
:
IStatusbarEntry
=
{
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
selectIndentation
'
,
"
Select Indentation
"
),
command
:
'
changeEditorIndentation
'
};
...
...
@@ -488,6 +496,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
props
:
IStatusbarEntry
=
{
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
selectEncoding
'
,
"
Select Encoding
"
),
command
:
'
workbench.action.editor.changeEncoding
'
};
...
...
@@ -503,6 +512,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
props
:
IStatusbarEntry
=
{
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
selectEOL
'
,
"
Select End of Line Sequence
"
),
command
:
'
workbench.action.editor.changeEOL
'
};
...
...
@@ -518,6 +528,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
props
:
IStatusbarEntry
=
{
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
selectLanguageMode
'
,
"
Select Language Mode
"
),
command
:
'
workbench.action.editor.changeLanguageMode
'
};
...
...
@@ -533,6 +544,7 @@ export class EditorStatus extends Disposable implements IWorkbenchContribution {
const
props
:
IStatusbarEntry
=
{
text
,
ariaLabel
:
text
,
tooltip
:
nls
.
localize
(
'
fileInfo
'
,
"
File Information
"
)
};
...
...
@@ -915,9 +927,9 @@ class ShowCurrentMarkerInStatusbarContribution extends Disposable {
const
line
=
this
.
currentMarker
.
message
.
split
(
/
\r\n
|
\r
|
\n
/g
)[
0
];
const
text
=
`
${
this
.
getType
(
this
.
currentMarker
)}
${
line
}
`
;
if
(
!
this
.
statusBarEntryAccessor
.
value
)
{
this
.
statusBarEntryAccessor
.
value
=
this
.
statusbarService
.
addEntry
({
text
:
''
},
'
statusbar.currentProblem
'
,
nls
.
localize
(
'
currentProblem
'
,
"
Current Problem
"
),
StatusbarAlignment
.
LEFT
);
this
.
statusBarEntryAccessor
.
value
=
this
.
statusbarService
.
addEntry
({
text
:
''
,
ariaLabel
:
''
},
'
statusbar.currentProblem
'
,
nls
.
localize
(
'
currentProblem
'
,
"
Current Problem
"
),
StatusbarAlignment
.
LEFT
);
}
this
.
statusBarEntryAccessor
.
value
.
update
({
text
});
this
.
statusBarEntryAccessor
.
value
.
update
({
text
,
ariaLabel
:
text
});
}
else
{
this
.
statusBarEntryAccessor
.
clear
();
}
...
...
src/vs/workbench/browser/parts/notifications/notificationsStatus.ts
浏览文件 @
b7a9bfa7
...
...
@@ -72,6 +72,7 @@ export class NotificationsStatus extends Disposable {
// Show the bell with a dot if there are unread or in-progress notifications
const
statusProperties
:
IStatusbarEntry
=
{
text
:
`
${
notificationsInProgress
>
0
||
this
.
newNotificationsCount
>
0
?
'
$(bell-dot)
'
:
'
$(bell)
'
}
`
,
ariaLabel
:
localize
(
'
status.notifications
'
,
"
Notifications
"
),
command
:
this
.
isNotificationsCenterVisible
?
HIDE_NOTIFICATIONS_CENTER
:
SHOW_NOTIFICATIONS_CENTER
,
tooltip
:
this
.
getTooltip
(
notificationsInProgress
),
showBeak
:
this
.
isNotificationsCenterVisible
...
...
@@ -179,7 +180,7 @@ export class NotificationsStatus extends Disposable {
let
statusMessageEntry
:
IStatusbarEntryAccessor
;
let
showHandle
:
any
=
setTimeout
(()
=>
{
statusMessageEntry
=
this
.
statusbarService
.
addEntry
(
{
text
:
message
},
{
text
:
message
,
ariaLabel
:
message
},
'
status.message
'
,
localize
(
'
status.message
'
,
"
Status Message
"
),
StatusbarAlignment
.
LEFT
,
...
...
src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
浏览文件 @
b7a9bfa7
...
...
@@ -681,7 +681,6 @@ class StatusbarEntryItem extends Disposable {
// Update: Text
if
(
!
this
.
entry
||
entry
.
text
!==
this
.
entry
.
text
)
{
this
.
label
.
text
=
entry
.
text
;
this
.
container
.
setAttribute
(
'
aria-label
'
,
entry
.
text
);
if
(
entry
.
text
)
{
show
(
this
.
labelContainer
);
...
...
@@ -690,6 +689,10 @@ class StatusbarEntryItem extends Disposable {
}
}
if
(
!
this
.
entry
||
entry
.
ariaLabel
!==
this
.
entry
.
ariaLabel
)
{
this
.
container
.
setAttribute
(
'
aria-label
'
,
entry
.
ariaLabel
);
}
// Update: Tooltip (on the container, because label can be disabled)
if
(
!
this
.
entry
||
entry
.
tooltip
!==
this
.
entry
.
tooltip
)
{
if
(
entry
.
tooltip
)
{
...
...
src/vs/workbench/contrib/debug/browser/debugStatus.ts
浏览文件 @
b7a9bfa7
...
...
@@ -61,11 +61,12 @@ export class DebugStatusContribution implements IWorkbenchContribution {
const
name
=
manager
.
selectedConfiguration
.
name
||
''
;
const
nameAndLaunchPresent
=
name
&&
manager
.
selectedConfiguration
.
launch
;
if
(
nameAndLaunchPresent
)
{
text
=
'
$(play)
'
+
(
manager
.
getLaunches
().
length
>
1
?
`
${
name
}
(
${
manager
.
selectedConfiguration
.
launch
!
.
name
}
)`
:
name
);
text
=
(
manager
.
getLaunches
().
length
>
1
?
`
${
name
}
(
${
manager
.
selectedConfiguration
.
launch
!
.
name
}
)`
:
name
);
}
return
{
text
:
text
,
text
:
'
$(play)
'
+
text
,
ariaLabel
:
nls
.
localize
(
'
debugTarget
'
,
"
Debug: {0}
"
,
text
),
tooltip
:
nls
.
localize
(
'
selectAndStartDebug
'
,
"
Select and start debug configuration
"
),
command
:
'
workbench.action.debug.selectandstart
'
};
...
...
src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts
浏览文件 @
b7a9bfa7
...
...
@@ -82,6 +82,7 @@ export class ExtensionHostProfileService extends Disposable implements IExtensio
if
(
visible
)
{
const
indicator
:
IStatusbarEntry
=
{
text
:
'
$(sync~spin)
'
+
nls
.
localize
(
'
profilingExtensionHost
'
,
"
Profiling Extension Host
"
),
ariaLabel
:
nls
.
localize
(
'
profilingExtensionHost
'
,
"
Profiling Extension Host
"
),
tooltip
:
nls
.
localize
(
'
selectAndStartDebug
'
,
"
Click to stop profiling.
"
),
command
:
'
workbench.action.extensionHostProfilder.stop
'
};
...
...
src/vs/workbench/contrib/feedback/browser/feedbackStatusbarItem.ts
浏览文件 @
b7a9bfa7
...
...
@@ -103,6 +103,7 @@ export class FeedbackStatusbarConribution extends Disposable implements IWorkben
private
getStatusEntry
(
showBeak
?:
boolean
):
IStatusbarEntry
{
return
{
text
:
'
$(feedback)
'
,
ariaLabel
:
localize
(
'
status.feedback
'
,
"
Tweet Feedback
"
),
tooltip
:
localize
(
'
status.feedback
'
,
"
Tweet Feedback
"
),
command
:
'
help.tweetFeedback
'
,
showBeak
...
...
src/vs/workbench/contrib/markers/browser/markers.contribution.ts
浏览文件 @
b7a9bfa7
...
...
@@ -361,9 +361,11 @@ class MarkersStatusBarContributions extends Disposable implements IWorkbenchCont
private
getMarkersItem
():
IStatusbarEntry
{
const
markersStatistics
=
this
.
markerService
.
getStatistics
();
const
tooltip
=
this
.
getMarkersTooltip
(
markersStatistics
);
return
{
text
:
this
.
getMarkersText
(
markersStatistics
),
tooltip
:
this
.
getMarkersTooltip
(
markersStatistics
),
ariaLabel
:
tooltip
,
tooltip
,
command
:
'
workbench.actions.view.toggleProblems
'
};
}
...
...
src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.ts
浏览文件 @
b7a9bfa7
...
...
@@ -35,9 +35,12 @@ export class KeyboardLayoutPickerContribution extends Disposable implements IWor
let
layout
=
this
.
keymapService
.
getCurrentKeyboardLayout
();
if
(
layout
)
{
let
layoutInfo
=
parseKeyboardLayoutDescription
(
layout
);
const
text
=
nls
.
localize
(
'
keyboardLayout
'
,
"
Layout: {0}
"
,
layoutInfo
.
label
);
this
.
pickerElement
.
value
=
this
.
statusbarService
.
addEntry
(
{
text
:
nls
.
localize
(
'
keyboardLayout
'
,
"
Layout: {0}
"
,
layoutInfo
.
label
),
text
,
ariaLabel
:
text
,
command
:
KEYBOARD_LAYOUT_OPEN_PICKER
},
'
status.workbench.keyboardLayout
'
,
...
...
@@ -51,14 +54,18 @@ export class KeyboardLayoutPickerContribution extends Disposable implements IWor
let
layoutInfo
=
parseKeyboardLayoutDescription
(
layout
);
if
(
this
.
pickerElement
.
value
)
{
const
text
=
nls
.
localize
(
'
keyboardLayout
'
,
"
Layout: {0}
"
,
layoutInfo
.
label
);
this
.
pickerElement
.
value
.
update
({
text
:
nls
.
localize
(
'
keyboardLayout
'
,
"
Layout: {0}
"
,
layoutInfo
.
label
),
text
,
ariaLabel
:
text
,
command
:
KEYBOARD_LAYOUT_OPEN_PICKER
});
}
else
{
const
text
=
nls
.
localize
(
'
keyboardLayout
'
,
"
Layout: {0}
"
,
layoutInfo
.
label
);
this
.
pickerElement
.
value
=
this
.
statusbarService
.
addEntry
(
{
text
:
nls
.
localize
(
'
keyboardLayout
'
,
"
Layout: {0}
"
,
layoutInfo
.
label
),
text
,
ariaLabel
:
text
,
command
:
KEYBOARD_LAYOUT_OPEN_PICKER
},
'
status.workbench.keyboardLayout
'
,
...
...
src/vs/workbench/contrib/remote/browser/remoteIndicator.ts
浏览文件 @
b7a9bfa7
...
...
@@ -169,7 +169,12 @@ export class RemoteWindowActiveIndicator extends Disposable implements IWorkbenc
private
renderWindowIndicator
(
text
:
string
,
tooltip
?:
string
,
command
?:
string
):
void
{
const
properties
:
IStatusbarEntry
=
{
backgroundColor
:
themeColorFromId
(
STATUS_BAR_HOST_NAME_BACKGROUND
),
color
:
themeColorFromId
(
STATUS_BAR_HOST_NAME_FOREGROUND
),
text
,
tooltip
,
command
backgroundColor
:
themeColorFromId
(
STATUS_BAR_HOST_NAME_BACKGROUND
),
color
:
themeColorFromId
(
STATUS_BAR_HOST_NAME_FOREGROUND
),
ariaLabel
:
nls
.
localize
(
'
remote
'
,
"
Remote
"
),
text
,
tooltip
,
command
};
if
(
this
.
windowIndicatorEntry
)
{
this
.
windowIndicatorEntry
.
update
(
properties
);
...
...
src/vs/workbench/contrib/scm/browser/activity.ts
浏览文件 @
b7a9bfa7
...
...
@@ -156,9 +156,12 @@ export class SCMStatusController implements IWorkbenchContribution {
const
disposables
=
new
DisposableStore
();
for
(
const
c
of
commands
)
{
const
tooltip
=
`
${
label
}
-
${
c
.
tooltip
}
`
;
disposables
.
add
(
this
.
statusbarService
.
addEntry
({
text
:
c
.
title
,
tooltip
:
`
${
label
}
-
${
c
.
tooltip
}
`
,
ariaLabel
:
tooltip
,
tooltip
,
command
:
c
},
'
status.scm
'
,
localize
(
'
status.scm
'
,
"
Source Control
"
),
MainThreadStatusBarAlignment
.
LEFT
,
10000
));
}
...
...
src/vs/workbench/contrib/tasks/browser/task.contribution.ts
浏览文件 @
b7a9bfa7
...
...
@@ -122,6 +122,7 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench
}
else
{
const
itemProps
:
IStatusbarEntry
=
{
text
:
`$(tools)
${
tasks
.
length
}
`
,
ariaLabel
:
nls
.
localize
(
'
numberOfRunningTasks
'
,
"
{0} running tasks
"
,
tasks
.
length
),
tooltip
:
nls
.
localize
(
'
runningTasks
'
,
"
Show Running Tasks
"
),
command
:
'
workbench.action.tasks.showTasks
'
,
};
...
...
src/vs/workbench/services/progress/browser/progressService.ts
浏览文件 @
b7a9bfa7
...
...
@@ -152,6 +152,7 @@ export class ProgressService extends Disposable implements IProgressService {
const
statusEntryProperties
:
IStatusbarEntry
=
{
text
:
`$(sync~spin)
${
text
}
`
,
ariaLabel
:
text
,
tooltip
:
title
,
command
:
progressCommand
};
...
...
src/vs/workbench/services/statusbar/common/statusbar.ts
浏览文件 @
b7a9bfa7
...
...
@@ -28,6 +28,11 @@ export interface IStatusbarEntry {
*/
readonly
text
:
string
;
/**
* Text to be read out by the screen reader.
*/
readonly
ariaLabel
:
string
;
/**
* An optional tooltip text to show when you hover over the entry
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录