Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
52fd22b1
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,发现更多精彩内容 >>
提交
52fd22b1
编写于
7月 01, 2020
作者:
J
João Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixes #99798
cc @roblourens for changes in settings
上级
88b1fa85
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
26 deletion
+46
-26
src/vs/base/browser/ui/list/listWidget.ts
src/vs/base/browser/ui/list/listWidget.ts
+1
-0
src/vs/platform/list/browser/listService.ts
src/vs/platform/list/browser/listService.ts
+34
-25
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
+11
-1
未找到文件。
src/vs/base/browser/ui/list/listWidget.ts
浏览文件 @
52fd22b1
...
@@ -854,6 +854,7 @@ export interface IListOptions<T> {
...
@@ -854,6 +854,7 @@ export interface IListOptions<T> {
readonly
horizontalScrolling
?:
boolean
;
readonly
horizontalScrolling
?:
boolean
;
readonly
additionalScrollHeight
?:
number
;
readonly
additionalScrollHeight
?:
number
;
readonly
transformOptimization
?:
boolean
;
readonly
transformOptimization
?:
boolean
;
readonly
smoothScrolling
?:
boolean
;
}
}
export
interface
IListStyles
{
export
interface
IListStyles
{
...
...
src/vs/platform/list/browser/listService.ts
浏览文件 @
52fd22b1
...
@@ -179,6 +179,8 @@ function toWorkbenchListOptions<T>(options: IListOptions<T>, configurationServic
...
@@ -179,6 +179,8 @@ function toWorkbenchListOptions<T>(options: IListOptions<T>, configurationServic
}
}
};
};
result
.
smoothScrolling
=
configurationService
.
getValue
<
boolean
>
(
listSmoothScrolling
);
return
[
result
,
disposables
];
return
[
result
,
disposables
];
}
}
...
@@ -193,7 +195,6 @@ export interface IWorkbenchListOptions<T> extends IWorkbenchListOptionsUpdate, I
...
@@ -193,7 +195,6 @@ export interface IWorkbenchListOptions<T> extends IWorkbenchListOptionsUpdate, I
export
class
WorkbenchList
<
T
>
extends
List
<
T
>
{
export
class
WorkbenchList
<
T
>
extends
List
<
T
>
{
readonly
contextKeyService
:
IContextKeyService
;
readonly
contextKeyService
:
IContextKeyService
;
private
readonly
configurationService
:
IConfigurationService
;
private
readonly
themeService
:
IThemeService
;
private
readonly
themeService
:
IThemeService
;
private
listHasSelectionOrFocus
:
IContextKey
<
boolean
>
;
private
listHasSelectionOrFocus
:
IContextKey
<
boolean
>
;
...
@@ -231,7 +232,6 @@ export class WorkbenchList<T> extends List<T> {
...
@@ -231,7 +232,6 @@ export class WorkbenchList<T> extends List<T> {
this
.
disposables
.
add
(
workbenchListOptionsDisposable
);
this
.
disposables
.
add
(
workbenchListOptionsDisposable
);
this
.
contextKeyService
=
createScopedContextKeyService
(
contextKeyService
,
this
);
this
.
contextKeyService
=
createScopedContextKeyService
(
contextKeyService
,
this
);
this
.
configurationService
=
configurationService
;
this
.
themeService
=
themeService
;
this
.
themeService
=
themeService
;
const
listSupportsMultiSelect
=
WorkbenchListSupportsMultiSelectContextKey
.
bindTo
(
this
.
contextKeyService
);
const
listSupportsMultiSelect
=
WorkbenchListSupportsMultiSelectContextKey
.
bindTo
(
this
.
contextKeyService
);
...
@@ -265,8 +265,25 @@ export class WorkbenchList<T> extends List<T> {
...
@@ -265,8 +265,25 @@ export class WorkbenchList<T> extends List<T> {
this
.
listHasSelectionOrFocus
.
set
(
selection
.
length
>
0
||
focus
.
length
>
0
);
this
.
listHasSelectionOrFocus
.
set
(
selection
.
length
>
0
||
focus
.
length
>
0
);
}));
}));
this
.
disposables
.
add
(
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
multiSelectModifierSettingKey
))
{
this
.
_useAltAsMultipleSelectionModifier
=
useAltAsMultipleSelectionModifier
(
configurationService
);
}
this
.
registerListeners
();
let
options
:
IListOptionsUpdate
=
{};
if
(
e
.
affectsConfiguration
(
horizontalScrollingKey
)
&&
this
.
horizontalScrolling
===
undefined
)
{
const
horizontalScrolling
=
configurationService
.
getValue
<
boolean
>
(
horizontalScrollingKey
);
options
=
{
...
options
,
horizontalScrolling
};
}
if
(
e
.
affectsConfiguration
(
listSmoothScrolling
))
{
const
smoothScrolling
=
configurationService
.
getValue
<
boolean
>
(
listSmoothScrolling
);
options
=
{
...
options
,
smoothScrolling
};
}
if
(
Object
.
keys
(
options
).
length
>
0
)
{
this
.
updateOptions
(
options
);
}
}));
}
}
updateOptions
(
options
:
IWorkbenchListOptionsUpdate
):
void
{
updateOptions
(
options
:
IWorkbenchListOptionsUpdate
):
void
{
...
@@ -292,18 +309,6 @@ export class WorkbenchList<T> extends List<T> {
...
@@ -292,18 +309,6 @@ export class WorkbenchList<T> extends List<T> {
this
.
_styler
=
attachListStyler
(
this
,
this
.
themeService
,
styles
);
this
.
_styler
=
attachListStyler
(
this
,
this
.
themeService
,
styles
);
}
}
private
registerListeners
():
void
{
this
.
disposables
.
add
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
multiSelectModifierSettingKey
))
{
this
.
_useAltAsMultipleSelectionModifier
=
useAltAsMultipleSelectionModifier
(
this
.
configurationService
);
}
if
(
e
.
affectsConfiguration
(
horizontalScrollingKey
)
&&
this
.
horizontalScrolling
===
undefined
)
{
const
horizontalScrolling
=
this
.
configurationService
.
getValue
<
boolean
>
(
horizontalScrollingKey
);
this
.
updateOptions
({
horizontalScrolling
});
}
}));
}
get
useAltAsMultipleSelectionModifier
():
boolean
{
get
useAltAsMultipleSelectionModifier
():
boolean
{
return
this
.
_useAltAsMultipleSelectionModifier
;
return
this
.
_useAltAsMultipleSelectionModifier
;
}
}
...
@@ -316,7 +321,6 @@ export interface IWorkbenchPagedListOptions<T> extends IWorkbenchListOptionsUpda
...
@@ -316,7 +321,6 @@ export interface IWorkbenchPagedListOptions<T> extends IWorkbenchListOptionsUpda
export
class
WorkbenchPagedList
<
T
>
extends
PagedList
<
T
>
{
export
class
WorkbenchPagedList
<
T
>
extends
PagedList
<
T
>
{
readonly
contextKeyService
:
IContextKeyService
;
readonly
contextKeyService
:
IContextKeyService
;
private
readonly
configurationService
:
IConfigurationService
;
private
readonly
disposables
:
DisposableStore
;
private
readonly
disposables
:
DisposableStore
;
...
@@ -350,7 +354,6 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
...
@@ -350,7 +354,6 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
this
.
disposables
.
add
(
workbenchListOptionsDisposable
);
this
.
disposables
.
add
(
workbenchListOptionsDisposable
);
this
.
contextKeyService
=
createScopedContextKeyService
(
contextKeyService
,
this
);
this
.
contextKeyService
=
createScopedContextKeyService
(
contextKeyService
,
this
);
this
.
configurationService
=
configurationService
;
this
.
horizontalScrolling
=
options
.
horizontalScrolling
;
this
.
horizontalScrolling
=
options
.
horizontalScrolling
;
const
listSupportsMultiSelect
=
WorkbenchListSupportsMultiSelectContextKey
.
bindTo
(
this
.
contextKeyService
);
const
listSupportsMultiSelect
=
WorkbenchListSupportsMultiSelectContextKey
.
bindTo
(
this
.
contextKeyService
);
...
@@ -365,17 +368,23 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
...
@@ -365,17 +368,23 @@ export class WorkbenchPagedList<T> extends PagedList<T> {
this
.
disposables
.
add
(
attachListStyler
(
this
,
themeService
,
options
.
overrideStyles
));
this
.
disposables
.
add
(
attachListStyler
(
this
,
themeService
,
options
.
overrideStyles
));
}
}
this
.
registerListeners
();
this
.
disposables
.
add
(
configurationService
.
onDidChangeConfiguration
(
e
=>
{
}
private
registerListeners
():
void
{
this
.
disposables
.
add
(
this
.
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
multiSelectModifierSettingKey
))
{
if
(
e
.
affectsConfiguration
(
multiSelectModifierSettingKey
))
{
this
.
_useAltAsMultipleSelectionModifier
=
useAltAsMultipleSelectionModifier
(
this
.
configurationService
);
this
.
_useAltAsMultipleSelectionModifier
=
useAltAsMultipleSelectionModifier
(
configurationService
);
}
}
let
options
:
IListOptionsUpdate
=
{};
if
(
e
.
affectsConfiguration
(
horizontalScrollingKey
)
&&
this
.
horizontalScrolling
===
undefined
)
{
if
(
e
.
affectsConfiguration
(
horizontalScrollingKey
)
&&
this
.
horizontalScrolling
===
undefined
)
{
const
horizontalScrolling
=
this
.
configurationService
.
getValue
<
boolean
>
(
horizontalScrollingKey
);
const
horizontalScrolling
=
configurationService
.
getValue
<
boolean
>
(
horizontalScrollingKey
);
this
.
updateOptions
({
horizontalScrolling
});
options
=
{
...
options
,
horizontalScrolling
};
}
if
(
e
.
affectsConfiguration
(
listSmoothScrolling
))
{
const
smoothScrolling
=
configurationService
.
getValue
<
boolean
>
(
listSmoothScrolling
);
options
=
{
...
options
,
smoothScrolling
};
}
if
(
Object
.
keys
(
options
).
length
>
0
)
{
this
.
updateOptions
(
options
);
}
}
}));
}));
}
}
...
...
src/vs/workbench/contrib/preferences/browser/settingsTree.ts
浏览文件 @
52fd22b1
...
@@ -1845,6 +1845,7 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
...
@@ -1845,6 +1845,7 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
viewState
:
ISettingsEditorViewState
,
viewState
:
ISettingsEditorViewState
,
renderers
:
ITreeRenderer
<
any
,
void
,
any
>
[],
renderers
:
ITreeRenderer
<
any
,
void
,
any
>
[],
@
IThemeService
themeService
:
IThemeService
,
@
IThemeService
themeService
:
IThemeService
,
@
IConfigurationService
configurationService
:
IConfigurationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
)
{
)
{
super
(
'
SettingsTree
'
,
container
,
super
(
'
SettingsTree
'
,
container
,
...
@@ -1870,7 +1871,8 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
...
@@ -1870,7 +1871,8 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
}
}
},
},
styleController
:
id
=>
new
DefaultStyleController
(
DOM
.
createStyleSheet
(
container
),
id
),
styleController
:
id
=>
new
DefaultStyleController
(
DOM
.
createStyleSheet
(
container
),
id
),
filter
:
instantiationService
.
createInstance
(
SettingsTreeFilter
,
viewState
)
filter
:
instantiationService
.
createInstance
(
SettingsTreeFilter
,
viewState
),
smoothScrolling
:
configurationService
.
getValue
<
boolean
>
(
'
workbench.list.smoothScrolling
'
),
});
});
this
.
disposables
.
clear
();
this
.
disposables
.
clear
();
...
@@ -1945,6 +1947,14 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
...
@@ -1945,6 +1947,14 @@ export class SettingsTree extends ObjectTree<SettingsTreeElement> {
},
colors
=>
{
},
colors
=>
{
this
.
style
(
colors
);
this
.
style
(
colors
);
}));
}));
this
.
disposables
.
add
(
configurationService
.
onDidChangeConfiguration
(
e
=>
{
if
(
e
.
affectsConfiguration
(
'
workbench.list.smoothScrolling
'
))
{
this
.
updateOptions
({
smoothScrolling
:
configurationService
.
getValue
<
boolean
>
(
'
workbench.list.smoothScrolling
'
)
});
}
}));
}
}
protected
createModel
(
user
:
string
,
view
:
IList
<
ITreeNode
<
SettingsTreeGroupChild
>>
,
options
:
IObjectTreeOptions
<
SettingsTreeGroupChild
>
):
ITreeModel
<
SettingsTreeGroupChild
|
null
,
void
,
SettingsTreeGroupChild
|
null
>
{
protected
createModel
(
user
:
string
,
view
:
IList
<
ITreeNode
<
SettingsTreeGroupChild
>>
,
options
:
IObjectTreeOptions
<
SettingsTreeGroupChild
>
):
ITreeModel
<
SettingsTreeGroupChild
|
null
,
void
,
SettingsTreeGroupChild
|
null
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录