Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
39edf26c
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,发现更多精彩内容 >>
提交
39edf26c
编写于
7月 29, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Settings editor - Tree focus outlines
上级
f8aa1fc2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
85 addition
and
43 deletion
+85
-43
src/vs/workbench/parts/preferences/browser/media/settingsEditor2.css
...bench/parts/preferences/browser/media/settingsEditor2.css
+0
-4
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
...vs/workbench/parts/preferences/browser/settingsEditor2.ts
+8
-36
src/vs/workbench/parts/preferences/browser/settingsTree.ts
src/vs/workbench/parts/preferences/browser/settingsTree.ts
+3
-0
src/vs/workbench/parts/preferences/browser/tocTree.ts
src/vs/workbench/parts/preferences/browser/tocTree.ts
+74
-3
未找到文件。
src/vs/workbench/parts/preferences/browser/media/settingsEditor2.css
浏览文件 @
39edf26c
...
...
@@ -136,10 +136,6 @@
justify-content
:
space-between
;
}
.settings-editor
>
.settings-body
.settings-tree-container
.monaco-tree
::before
{
outline
:
none
!important
;
}
.settings-editor.search-mode
>
.settings-body
.settings-tree-container
.monaco-tree-wrapper
,
.settings-editor.search-mode
>
.settings-body
>
.settings-tree-container
.setting-measure-container
{
width
:
calc
(
100%
-
11px
);
...
...
src/vs/workbench/parts/preferences/browser/settingsEditor2.ts
浏览文件 @
39edf26c
...
...
@@ -15,8 +15,6 @@ import * as collections from 'vs/base/common/collections';
import
{
getErrorMessage
,
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
ITreeConfiguration
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
DefaultTreestyler
,
OpenMode
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
collapseAll
,
expandAll
}
from
'
vs/base/parts/tree/browser/treeUtils
'
;
import
'
vs/css!./media/settingsEditor2
'
;
import
{
localize
}
from
'
vs/nls
'
;
...
...
@@ -25,20 +23,18 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
WorkbenchTree
,
WorkbenchTreeController
}
from
'
vs/platform/list/browser/listService
'
;
import
{
WorkbenchTree
}
from
'
vs/platform/list/browser/listService
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
editorBackground
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
attachButtonStyler
,
attachStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
attachButtonStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
BaseEditor
}
from
'
vs/workbench/browser/parts/editor/baseEditor
'
;
import
{
EditorOptions
,
IEditor
}
from
'
vs/workbench/common/editor
'
;
import
{
PreferencesEditor
}
from
'
vs/workbench/parts/preferences/browser/preferencesEditor
'
;
import
{
SearchWidget
,
SettingsTarget
,
SettingsTargetsWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
import
{
commonlyUsedData
,
tocData
}
from
'
vs/workbench/parts/preferences/browser/settingsLayout
'
;
import
{
ISettingsEditorViewState
,
MODIFIED_SETTING_TAG
,
ONLINE_SERVICES_SETTING_TAG
,
resolveExtensionsSettings
,
resolveSettingsTree
,
SearchResultIdx
,
SearchResultModel
,
SettingsRenderer
,
SettingsTree
,
SettingsTreeElement
,
SettingsTreeFilter
,
SettingsTreeGroupElement
,
SettingsTreeModel
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
settingsHeaderForeground
}
from
'
vs/workbench/parts/preferences/browser/settingsWidgets
'
;
import
{
TOCDataSource
,
TOCRenderer
,
TOCTreeModel
}
from
'
vs/workbench/parts/preferences/browser/tocTree
'
;
import
{
ISettingsEditorViewState
,
MODIFIED_SETTING_TAG
,
ONLINE_SERVICES_SETTING_TAG
,
resolveExtensionsSettings
,
resolveSettingsTree
,
SearchResultIdx
,
SearchResultModel
,
SettingsRenderer
,
SettingsTree
,
SettingsTreeElement
,
SettingsTreeGroupElement
,
SettingsTreeModel
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
TOCRenderer
,
TOCTree
,
TOCTreeModel
}
from
'
vs/workbench/parts/preferences/browser/tocTree
'
;
import
{
CONTEXT_SETTINGS_EDITOR
,
CONTEXT_SETTINGS_FIRST_ROW_FOCUS
,
CONTEXT_SETTINGS_ROW_FOCUS
,
CONTEXT_SETTINGS_SEARCH_FOCUS
,
CONTEXT_TOC_ROW_FOCUS
,
IPreferencesSearchService
,
ISearchProvider
}
from
'
vs/workbench/parts/preferences/common/preferences
'
;
import
{
IPreferencesService
,
ISearchResult
,
ISettingsEditorModel
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
SettingsEditor2Input
}
from
'
vs/workbench/services/preferences/common/preferencesEditorInput
'
;
...
...
@@ -290,40 +286,16 @@ export class SettingsEditor2 extends BaseEditor {
}
private
createTOC
(
parent
:
HTMLElement
):
void
{
this
.
tocTreeModel
=
new
TOCTreeModel
();
this
.
tocTreeContainer
=
DOM
.
append
(
parent
,
$
(
'
.settings-toc-container
'
));
const
tocDataSource
=
this
.
instantiationService
.
createInstance
(
TOCDataSource
);
const
tocRenderer
=
this
.
instantiationService
.
createInstance
(
TOCRenderer
);
this
.
tocTreeModel
=
new
TOCTreeModel
();
this
.
tocTree
=
this
.
instantiationService
.
createInstance
(
WorkbenchTree
,
this
.
tocTreeContainer
,
<
ITreeConfiguration
>
{
dataSource
:
tocDataSource
,
renderer
:
tocRenderer
,
controller
:
this
.
instantiationService
.
createInstance
(
WorkbenchTreeController
,
{
openMode
:
OpenMode
.
DOUBLE_CLICK
}),
filter
:
this
.
instantiationService
.
createInstance
(
SettingsTreeFilter
,
this
.
viewState
),
styler
:
new
DefaultTreestyler
(
DOM
.
createStyleSheet
(),
'
settings-toc-tree
'
),
},
this
.
tocTree
=
this
.
instantiationService
.
createInstance
(
TOCTree
,
this
.
tocTreeContainer
,
this
.
viewState
,
{
showLoading
:
false
,
twistiePixels
:
15
renderer
:
tocRenderer
});
this
.
tocTree
.
getHTMLElement
().
classList
.
add
(
'
settings-toc-tree
'
);
this
.
_register
(
attachStyler
(
this
.
themeService
,
{
listActiveSelectionBackground
:
editorBackground
,
listActiveSelectionForeground
:
settingsHeaderForeground
,
listFocusAndSelectionBackground
:
editorBackground
,
listFocusAndSelectionForeground
:
settingsHeaderForeground
,
listFocusBackground
:
editorBackground
,
listFocusForeground
:
settingsHeaderForeground
,
listHoverForeground
:
foreground
,
listHoverBackground
:
editorBackground
,
listInactiveSelectionBackground
:
editorBackground
,
listInactiveSelectionForeground
:
settingsHeaderForeground
,
},
colors
=>
{
this
.
tocTree
.
style
(
colors
);
}));
this
.
_register
(
this
.
tocTree
.
onDidChangeFocus
(
e
=>
{
const
element
=
e
.
focus
;
...
...
src/vs/workbench/parts/preferences/browser/settingsTree.ts
浏览文件 @
39edf26c
...
...
@@ -1512,6 +1512,9 @@ export class SettingsTree extends NonExpandableTree {
const
activeBorderColor
=
theme
.
getColor
(
focusBorder
);
if
(
activeBorderColor
)
{
collector
.
addRule
(
`.settings-editor > .settings-body > .settings-tree-container .monaco-tree:focus .monaco-tree-row.focused {outline: solid 1px
${
activeBorderColor
}
; outline-offset: -1px; }`
);
// TODO@rob - why isn't this applied when added to the stylesheet from tocTree.ts? Seems like a chromium glitch.
collector
.
addRule
(
`.settings-editor > .settings-body > .settings-toc-container .monaco-tree:focus .monaco-tree-row.focused {outline: solid 1px
${
activeBorderColor
}
; outline-offset: -1px; }`
);
}
const
inactiveBorderColor
=
theme
.
getColor
(
settingItemInactiveSelectionBorder
);
...
...
src/vs/workbench/parts/preferences/browser/tocTree.ts
浏览文件 @
39edf26c
...
...
@@ -5,10 +5,18 @@
import
*
as
DOM
from
'
vs/base/browser/dom
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDataSource
,
IRenderer
,
ITree
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
SearchResultModel
,
SettingsTreeElement
,
SettingsTreeGroupElement
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
ISetting
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
IDataSource
,
IRenderer
,
ITree
,
ITreeConfiguration
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
DefaultTreestyler
,
OpenMode
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IContextKeyService
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IListService
,
WorkbenchTree
,
WorkbenchTreeController
}
from
'
vs/platform/list/browser/listService
'
;
import
{
editorBackground
,
focusBorder
,
foreground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
attachStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
ICssStyleCollector
,
ITheme
,
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
ISettingsEditorViewState
,
SearchResultModel
,
SettingsAccessibilityProvider
,
SettingsTreeElement
,
SettingsTreeFilter
,
SettingsTreeGroupElement
,
SettingsTreeSettingElement
}
from
'
vs/workbench/parts/preferences/browser/settingsTree
'
;
import
{
settingsHeaderForeground
}
from
'
vs/workbench/parts/preferences/browser/settingsWidgets
'
;
import
{
ISetting
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
const
$
=
DOM
.
$
;
...
...
@@ -137,3 +145,66 @@ export class TOCRenderer implements IRenderer {
disposeTemplate
(
tree
:
ITree
,
templateId
:
string
,
templateData
:
any
):
void
{
}
}
export
class
TOCTree
extends
WorkbenchTree
{
constructor
(
container
:
HTMLElement
,
viewState
:
ISettingsEditorViewState
,
configuration
:
Partial
<
ITreeConfiguration
>
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IListService
listService
:
IListService
,
@
IThemeService
themeService
:
IThemeService
,
@
IInstantiationService
instantiationService
:
IInstantiationService
,
@
IConfigurationService
configurationService
:
IConfigurationService
)
{
const
treeClass
=
'
settings-toc-tree
'
;
const
fullConfiguration
=
<
ITreeConfiguration
>
{
controller
:
instantiationService
.
createInstance
(
WorkbenchTreeController
,
{
openMode
:
OpenMode
.
DOUBLE_CLICK
}),
filter
:
instantiationService
.
createInstance
(
SettingsTreeFilter
,
viewState
),
styler
:
new
DefaultTreestyler
(
DOM
.
createStyleSheet
(),
treeClass
),
dataSource
:
instantiationService
.
createInstance
(
TOCDataSource
),
accessibilityProvider
:
instantiationService
.
createInstance
(
SettingsAccessibilityProvider
),
...
configuration
};
const
options
=
{
showLoading
:
false
,
twistiePixels
:
15
};
super
(
container
,
fullConfiguration
,
options
,
contextKeyService
,
listService
,
themeService
,
instantiationService
,
configurationService
);
this
.
disposables
.
push
(
registerThemingParticipant
((
theme
:
ITheme
,
collector
:
ICssStyleCollector
)
=>
{
const
activeBorderColor
=
theme
.
getColor
(
focusBorder
);
if
(
activeBorderColor
)
{
collector
.
addRule
(
`.settings-editor > .settings-body > .settings-toc-container .monaco-tree:focus .monaco-tree-row.focused { outline-color:
${
activeBorderColor
}
; }`
);
}
}));
this
.
getHTMLElement
().
classList
.
add
(
treeClass
);
this
.
disposables
.
push
(
attachStyler
(
themeService
,
{
listActiveSelectionBackground
:
editorBackground
,
listActiveSelectionForeground
:
settingsHeaderForeground
,
listFocusAndSelectionBackground
:
editorBackground
,
listFocusAndSelectionForeground
:
settingsHeaderForeground
,
listFocusBackground
:
editorBackground
,
listFocusForeground
:
settingsHeaderForeground
,
listHoverForeground
:
foreground
,
listHoverBackground
:
editorBackground
,
listInactiveSelectionBackground
:
editorBackground
,
listInactiveSelectionForeground
:
settingsHeaderForeground
,
},
colors
=>
{
this
.
style
(
colors
);
}));
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录