Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1be2f051
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,发现更多精彩内容 >>
提交
1be2f051
编写于
5月 23, 2017
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Show accessibility status in the status bar
上级
300d44c2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
1 deletion
+42
-1
src/vs/workbench/browser/parts/editor/editorStatus.ts
src/vs/workbench/browser/parts/editor/editorStatus.ts
+39
-1
src/vs/workbench/browser/parts/editor/media/editorstatus.css
src/vs/workbench/browser/parts/editor/media/editorstatus.css
+3
-0
未找到文件。
src/vs/workbench/browser/parts/editor/editorStatus.ts
浏览文件 @
1be2f051
...
...
@@ -14,6 +14,7 @@ import paths = require('vs/base/common/paths');
import
types
=
require
(
'
vs/base/common/types
'
);
import
uri
from
'
vs/base/common/uri
'
;
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
{
IStatusbarItem
}
from
'
vs/workbench/browser/parts/statusbar/statusbar
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
language
,
LANGUAGE_DEFAULT
}
from
'
vs/base/common/platform
'
;
...
...
@@ -78,6 +79,7 @@ class StateChange {
encoding
:
boolean
;
EOL
:
boolean
;
tabFocusMode
:
boolean
;
screenReaderMode
:
boolean
;
metadata
:
boolean
;
constructor
()
{
...
...
@@ -87,6 +89,7 @@ class StateChange {
this
.
encoding
=
false
;
this
.
EOL
=
false
;
this
.
tabFocusMode
=
false
;
this
.
screenReaderMode
=
false
;
this
.
metadata
=
false
;
}
...
...
@@ -97,6 +100,7 @@ class StateChange {
this
.
encoding
=
this
.
encoding
||
other
.
encoding
;
this
.
EOL
=
this
.
EOL
||
other
.
EOL
;
this
.
tabFocusMode
=
this
.
tabFocusMode
||
other
.
tabFocusMode
;
this
.
screenReaderMode
=
this
.
screenReaderMode
||
other
.
screenReaderMode
;
this
.
metadata
=
this
.
metadata
||
other
.
metadata
;
}
}
...
...
@@ -108,6 +112,7 @@ interface StateDelta {
EOL
?:
string
;
indentation
?:
string
;
tabFocusMode
?:
boolean
;
screenReaderMode
?:
boolean
;
metadata
?:
string
;
}
...
...
@@ -130,6 +135,9 @@ class State {
private
_tabFocusMode
:
boolean
;
public
get
tabFocusMode
():
boolean
{
return
this
.
_tabFocusMode
;
}
private
_screenReaderMode
:
boolean
;
public
get
screenReaderMode
():
boolean
{
return
this
.
_screenReaderMode
;
}
private
_metadata
:
string
;
public
get
metadata
():
string
{
return
this
.
_metadata
;
}
...
...
@@ -139,6 +147,7 @@ class State {
this
.
_encoding
=
null
;
this
.
_EOL
=
null
;
this
.
_tabFocusMode
=
false
;
this
.
_screenReaderMode
=
false
;
this
.
_metadata
=
null
;
}
...
...
@@ -188,6 +197,13 @@ class State {
e
.
tabFocusMode
=
true
;
}
}
if
(
typeof
update
.
screenReaderMode
!==
'
undefined
'
)
{
if
(
this
.
_screenReaderMode
!==
update
.
screenReaderMode
)
{
this
.
_screenReaderMode
=
update
.
screenReaderMode
;
somethingChanged
=
true
;
e
.
screenReaderMode
=
true
;
}
}
if
(
typeof
update
.
metadata
!==
'
undefined
'
)
{
if
(
this
.
_metadata
!==
update
.
metadata
)
{
this
.
_metadata
=
update
.
metadata
;
...
...
@@ -210,6 +226,7 @@ const nlsMultiSelection = nls.localize('multiSelection', "{0} selections");
const
nlsEOLLF
=
nls
.
localize
(
'
endOfLineLineFeed
'
,
"
LF
"
);
const
nlsEOLCRLF
=
nls
.
localize
(
'
endOfLineCarriageReturnLineFeed
'
,
"
CRLF
"
);
const
nlsTabFocusMode
=
nls
.
localize
(
'
tabFocusModeEnabled
'
,
"
Tab moves focus
"
);
const
nlsScreenReaderDetected
=
nls
.
localize
(
'
screenReaderDetected
'
,
"
Screen reader detected
"
);
function
_setDisplay
(
el
:
HTMLElement
,
desiredValue
:
string
):
void
{
if
(
el
.
style
.
display
!==
desiredValue
)
{
...
...
@@ -228,6 +245,7 @@ export class EditorStatus implements IStatusbarItem {
private
state
:
State
;
private
element
:
HTMLElement
;
private
tabFocusModeElement
:
HTMLElement
;
private
screenRedearModeElement
:
HTMLElement
;
private
indentationElement
:
HTMLElement
;
private
selectionElement
:
HTMLElement
;
private
encodingElement
:
HTMLElement
;
...
...
@@ -262,6 +280,10 @@ export class EditorStatus implements IStatusbarItem {
this
.
tabFocusModeElement
.
textContent
=
nlsTabFocusMode
;
hide
(
this
.
tabFocusModeElement
);
this
.
screenRedearModeElement
=
append
(
this
.
element
,
$
(
'
a.editor-status-screenreadermode.status-bar-info
'
));
this
.
screenRedearModeElement
.
textContent
=
nlsScreenReaderDetected
;
hide
(
this
.
screenRedearModeElement
);
this
.
selectionElement
=
append
(
this
.
element
,
$
(
'
a.editor-status-selection
'
));
this
.
selectionElement
.
title
=
nls
.
localize
(
'
gotoLine
'
,
"
Go to Line
"
);
this
.
selectionElement
.
onclick
=
()
=>
this
.
onSelectionClick
();
...
...
@@ -306,8 +328,10 @@ export class EditorStatus implements IStatusbarItem {
this
.
editorGroupService
.
onEditorsChanged
(()
=>
this
.
onEditorsChanged
()),
this
.
untitledEditorService
.
onDidChangeEncoding
(
r
=>
this
.
onResourceEncodingChange
(
r
)),
this
.
textFileService
.
models
.
onModelEncodingChanged
(
e
=>
this
.
onResourceEncodingChange
(
e
.
resource
)),
TabFocus
.
onDidChangeTabFocus
(
e
=>
this
.
onTabFocusModeChange
())
TabFocus
.
onDidChangeTabFocus
(
e
=>
this
.
onTabFocusModeChange
()),
browser
.
onDidChangeAccessibilitySupport
(()
=>
this
.
onScreenReaderModeChange
())
);
this
.
onScreenReaderModeChange
();
return
combinedDisposable
(
this
.
toDispose
);
}
...
...
@@ -341,6 +365,14 @@ export class EditorStatus implements IStatusbarItem {
}
}
if
(
changed
.
screenReaderMode
)
{
if
(
this
.
state
.
screenReaderMode
&&
this
.
state
.
screenReaderMode
===
true
)
{
show
(
this
.
screenRedearModeElement
);
}
else
{
hide
(
this
.
screenRedearModeElement
);
}
}
if
(
changed
.
indentation
)
{
if
(
this
.
state
.
indentation
)
{
this
.
indentationElement
.
textContent
=
this
.
state
.
indentation
;
...
...
@@ -653,6 +685,12 @@ export class EditorStatus implements IStatusbarItem {
this
.
updateState
(
info
);
}
private
onScreenReaderModeChange
():
void
{
const
info
:
StateDelta
=
{
screenReaderMode
:
browser
.
getAccessibilitySupport
()
===
browser
.
AccessibilitySupport
.
Enabled
};
this
.
updateState
(
info
);
}
private
isActiveEditor
(
e
:
IBaseEditor
):
boolean
{
const
activeEditor
=
this
.
editorService
.
getActiveEditor
();
...
...
src/vs/workbench/browser/parts/editor/media/editorstatus.css
浏览文件 @
1be2f051
...
...
@@ -22,4 +22,7 @@
.monaco-workbench
.editor-statusbar-item
>
.editor-status-tabfocusmode
{
padding
:
0
5px
0
5px
;
}
.monaco-workbench
.editor-statusbar-item
>
.editor-status-screenreadermode
{
padding
:
0
5px
0
5px
;
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录