Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2ca50c08
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,发现更多精彩内容 >>
提交
2ca50c08
编写于
7月 24, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #31146
上级
9b6cc9f7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
7 deletion
+31
-7
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
.../workbench/parts/preferences/browser/preferencesEditor.ts
+23
-4
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
...workbench/parts/preferences/browser/preferencesWidgets.ts
+8
-3
未找到文件。
src/vs/workbench/parts/preferences/browser/preferencesEditor.ts
浏览文件 @
2ca50c08
...
...
@@ -57,6 +57,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe
import
{
attachStylerCallback
}
from
'
vs/platform/theme/common/styler
'
;
import
{
scrollbarShadow
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IWorkspaceContextService
}
from
"
vs/platform/workspace/common/workspace
"
;
import
Event
,
{
Emitter
}
from
"
vs/base/common/event
"
;
export
class
PreferencesEditorInput
extends
SideBySideEditorInput
{
public
static
ID
:
string
=
'
workbench.editorinputs.preferencesEditorInput
'
;
...
...
@@ -112,6 +113,7 @@ export class PreferencesEditor extends BaseEditor {
private
delayedFilterLogging
:
Delayer
<
void
>
;
private
latestEmptyFilters
:
string
[]
=
[];
private
lastFocusedWidget
:
SearchWidget
|
SideBySidePreferencesWidget
=
null
;
constructor
(
@
IPreferencesService
private
preferencesService
:
IPreferencesService
,
...
...
@@ -142,12 +144,16 @@ export class PreferencesEditor extends BaseEditor {
}));
this
.
_register
(
this
.
searchWidget
.
onDidChange
(
value
=>
this
.
filterPreferences
(
value
.
trim
())));
this
.
_register
(
this
.
searchWidget
.
onNavigate
(
shift
=>
this
.
preferencesRenderers
.
focusNextPreference
(
!
shift
)));
this
.
_register
(
this
.
searchWidget
.
onFocus
(()
=>
this
.
lastFocusedWidget
=
this
.
searchWidget
));
this
.
lastFocusedWidget
=
this
.
searchWidget
;
this
.
settingsTargetsWidget
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
SettingsTargetsWidget
,
this
.
headerContainer
,
this
.
preferencesService
.
userSettingsResource
));
this
.
_register
(
this
.
settingsTargetsWidget
.
onDidTargetChange
(
target
=>
this
.
switchSettings
(
target
)));
const
editorsContainer
=
DOM
.
append
(
parentElement
,
DOM
.
$
(
'
.preferences-editors-container
'
));
this
.
sideBySidePreferencesWidget
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
SideBySidePreferencesWidget
,
editorsContainer
));
this
.
_register
(
this
.
sideBySidePreferencesWidget
.
onFocus
(()
=>
this
.
lastFocusedWidget
=
this
.
sideBySidePreferencesWidget
));
this
.
preferencesRenderers
=
this
.
_register
(
new
PreferencesRenderers
());
}
...
...
@@ -169,7 +175,9 @@ export class PreferencesEditor extends BaseEditor {
}
public
focus
():
void
{
this
.
searchWidget
.
focus
();
if
(
this
.
lastFocusedWidget
)
{
this
.
lastFocusedWidget
.
focus
();
}
}
public
focusSearch
(
filter
?:
string
):
void
{
...
...
@@ -405,10 +413,15 @@ class SideBySidePreferencesWidget extends Widget {
private
dimension
:
Dimension
;
private
defaultPreferencesEditor
:
DefaultPreferencesEditor
;
private
editablePreferencesEditor
:
EditableSettingsEditor
;
private
defaultPreferencesEditorContainer
:
HTMLElement
;
private
editablePreferencesEditor
:
BaseEditor
;
private
editablePreferencesEditorContainer
:
HTMLElement
;
private
_onFocus
:
Emitter
<
void
>
=
new
Emitter
<
void
>
();
readonly
onFocus
:
Event
<
void
>
=
this
.
_onFocus
.
event
;
private
lastFocusedEditor
:
BaseEditor
;
private
sash
:
VSash
;
constructor
(
parent
:
HTMLElement
,
@
IInstantiationService
private
instantiationService
:
IInstantiationService
,
@
IThemeService
private
themeService
:
IThemeService
)
{
...
...
@@ -425,12 +438,15 @@ class SideBySidePreferencesWidget extends Widget {
this
.
defaultPreferencesEditor
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
DefaultPreferencesEditor
));
this
.
defaultPreferencesEditor
.
create
(
new
Builder
(
this
.
defaultPreferencesEditorContainer
));
this
.
defaultPreferencesEditor
.
setVisible
(
true
);
(
<
CodeEditor
>
this
.
defaultPreferencesEditor
.
getControl
()).
onDidFocusEditor
(()
=>
this
.
lastFocusedEditor
=
this
.
defaultPreferencesEditor
);
this
.
editablePreferencesEditorContainer
=
DOM
.
append
(
parentElement
,
DOM
.
$
(
'
.editable-preferences-editor-container
'
));
this
.
editablePreferencesEditorContainer
.
style
.
position
=
'
absolute
'
;
this
.
editablePreferencesEditor
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
EditableSettingsEditor
));
this
.
editablePreferencesEditor
.
create
(
new
Builder
(
this
.
editablePreferencesEditorContainer
));
this
.
editablePreferencesEditor
.
setVisible
(
true
);
(
<
CodeEditor
>
this
.
editablePreferencesEditor
.
getControl
()).
onDidFocusEditor
(()
=>
this
.
lastFocusedEditor
=
this
.
editablePreferencesEditor
);
this
.
lastFocusedEditor
=
this
.
editablePreferencesEditor
;
this
.
_register
(
attachStylerCallback
(
this
.
themeService
,
{
scrollbarShadow
},
colors
=>
{
const
shadow
=
colors
.
scrollbarShadow
?
colors
.
scrollbarShadow
.
toString
()
:
null
;
...
...
@@ -441,6 +457,9 @@ class SideBySidePreferencesWidget extends Widget {
this
.
editablePreferencesEditorContainer
.
style
.
boxShadow
=
null
;
}
}));
const
focusTracker
=
this
.
_register
(
DOM
.
trackFocus
(
parentElement
));
this
.
_register
(
focusTracker
.
addFocusListener
(()
=>
this
.
_onFocus
.
fire
()));
}
public
setInput
(
defaultPreferencesEditorInput
:
DefaultPreferencesEditorInput
,
editablePreferencesEditorInput
:
EditorInput
,
options
?:
EditorOptions
):
TPromise
<
{
defaultPreferencesRenderer
:
IPreferencesRenderer
<
ISetting
>
,
editablePreferencesRenderer
:
IPreferencesRenderer
<
ISetting
>
}
>
{
...
...
@@ -456,8 +475,8 @@ class SideBySidePreferencesWidget extends Widget {
}
public
focus
():
void
{
if
(
this
.
editablePreferences
Editor
)
{
this
.
editablePreferences
Editor
.
focus
();
if
(
this
.
lastFocused
Editor
)
{
this
.
lastFocused
Editor
.
focus
();
}
}
...
...
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
浏览文件 @
2ca50c08
...
...
@@ -384,12 +384,15 @@ export class SearchWidget extends Widget {
private
searchContainer
:
HTMLElement
;
private
inputBox
:
InputBox
;
private
_onDidChange
=
this
.
_register
(
new
Emitter
<
string
>
());
private
_onDidChange
:
Emitter
<
string
>
=
this
.
_register
(
new
Emitter
<
string
>
());
public
readonly
onDidChange
:
Event
<
string
>
=
this
.
_onDidChange
.
event
;
private
_onNavigate
=
this
.
_register
(
new
Emitter
<
boolean
>
());
private
_onNavigate
:
Emitter
<
boolean
>
=
this
.
_register
(
new
Emitter
<
boolean
>
());
public
readonly
onNavigate
:
Event
<
boolean
>
=
this
.
_onNavigate
.
event
;
private
_onFocus
:
Emitter
<
void
>
=
this
.
_register
(
new
Emitter
<
void
>
());
public
readonly
onFocus
:
Event
<
void
>
=
this
.
_onFocus
.
event
;
constructor
(
parent
:
HTMLElement
,
protected
options
:
SearchOptions
,
@
IContextViewService
private
contextViewService
:
IContextViewService
,
@
IContextMenuService
private
contextMenuService
:
IContextMenuService
,
...
...
@@ -418,8 +421,10 @@ export class SearchWidget extends Widget {
}));
this
.
inputBox
.
inputElement
.
setAttribute
(
'
aria-live
'
,
'
assertive
'
);
const
focusTracker
=
this
.
_register
(
DOM
.
trackFocus
(
this
.
inputBox
.
inputElement
));
this
.
_register
(
focusTracker
.
addFocusListener
(()
=>
this
.
_onFocus
.
fire
()));
if
(
this
.
options
.
focusKey
)
{
const
focusTracker
=
this
.
_register
(
DOM
.
trackFocus
(
this
.
inputBox
.
inputElement
));
this
.
_register
(
focusTracker
.
addFocusListener
(()
=>
this
.
options
.
focusKey
.
set
(
true
)));
this
.
_register
(
focusTracker
.
addBlurListener
(()
=>
this
.
options
.
focusKey
.
set
(
false
)));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录