Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
468346df
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,发现更多精彩内容 >>
提交
468346df
编写于
6月 23, 2017
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #29312
上级
689a8236
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
107 addition
and
2 deletion
+107
-2
src/vs/workbench/parts/preferences/browser/media/preferences.css
...workbench/parts/preferences/browser/media/preferences.css
+26
-0
src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts
...rkbench/parts/preferences/browser/preferencesRenderers.ts
+23
-1
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
...workbench/parts/preferences/browser/preferencesWidgets.ts
+57
-0
src/vs/workbench/parts/preferences/common/preferencesModels.ts
...s/workbench/parts/preferences/common/preferencesModels.ts
+1
-1
未找到文件。
src/vs/workbench/parts/preferences/browser/media/preferences.css
浏览文件 @
468346df
...
...
@@ -134,6 +134,32 @@
padding-left
:
10px
;
}
.monaco-editor
.settings-header-widget
.title-container
{
padding-left
:
12px
;
display
:
flex
;
}
.vs
.monaco-editor
.settings-header-widget
.title-container
{
color
:
#6f6f6f
;
}
.vs-dark
.monaco-editor
.settings-header-widget
.title-container
{
color
:
#bbbbbb
;
}
.hc-black
.monaco-editor
.settings-header-widget
.title-container
{
color
:
white
;
}
.monaco-editor
.settings-header-widget
.title-container
.title
{
font-weight
:
bold
;
white-space
:
nowrap
;
text-transform
:
uppercase
;
}
.monaco-editor
.settings-header-widget
.title-container
.message
{
padding-left
:
12px
;
white-space
:
nowrap
;
}
.monaco-editor
.settings-group-title-widget
{
z-index
:
1
;
}
...
...
src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts
浏览文件 @
468346df
...
...
@@ -19,7 +19,7 @@ import { IPreferencesService, ISettingsGroup, ISetting, IPreferencesEditorModel,
import
{
SettingsEditorModel
,
DefaultSettingsEditorModel
}
from
'
vs/workbench/parts/preferences/common/preferencesModels
'
;
import
{
ICodeEditor
,
IEditorMouseEvent
,
MouseTargetType
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
IContextMenuService
,
ContextSubMenu
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
SettingsGroupTitleWidget
,
EditPreferenceWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
import
{
SettingsGroupTitleWidget
,
EditPreferenceWidget
,
SettingsHeaderWidget
}
from
'
vs/workbench/parts/preferences/browser/preferencesWidgets
'
;
import
{
ITelemetryService
}
from
'
vs/platform/telemetry/common/telemetry
'
;
import
{
RangeHighlightDecorations
}
from
'
vs/workbench/common/editor/rangeDecorations
'
;
import
{
IConfigurationEditingService
,
IConfigurationEditingError
,
ConfigurationEditingErrorCode
,
ConfigurationTarget
}
from
'
vs/workbench/services/configuration/common/configurationEditing
'
;
...
...
@@ -186,6 +186,7 @@ export class WorkspaceSettingsRenderer extends UserSettingsRenderer implements I
export
class
DefaultSettingsRenderer
extends
Disposable
implements
IPreferencesRenderer
<
ISetting
>
{
private
settingHighlighter
:
SettingHighlighter
;
private
settingsHeaderRenderer
:
SettingsHeaderRenderer
;
private
settingsGroupTitleRenderer
:
SettingsGroupTitleRenderer
;
private
filteredMatchesRenderer
:
FilteredMatchesRenderer
;
private
hiddenAreasRenderer
:
HiddenAreasRenderer
;
...
...
@@ -211,6 +212,7 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
this
.
_register
(
preferencesModel
);
this
.
_register
(
_associatedPreferencesModel
);
this
.
settingHighlighter
=
this
.
_register
(
instantiationService
.
createInstance
(
SettingHighlighter
,
editor
,
this
.
_onFocusPreference
,
this
.
_onClearFocusPreference
));
this
.
settingsHeaderRenderer
=
this
.
_register
(
instantiationService
.
createInstance
(
SettingsHeaderRenderer
,
editor
));
this
.
settingsGroupTitleRenderer
=
this
.
_register
(
instantiationService
.
createInstance
(
SettingsGroupTitleRenderer
,
editor
));
this
.
filteredMatchesRenderer
=
this
.
_register
(
instantiationService
.
createInstance
(
FilteredMatchesRenderer
,
editor
));
this
.
editSettingActionRenderer
=
this
.
_register
(
instantiationService
.
createInstance
(
EditSettingRenderer
,
editor
,
preferencesModel
,
this
.
settingHighlighter
));
...
...
@@ -244,11 +246,13 @@ export class DefaultSettingsRenderer extends Disposable implements IPreferencesR
if
(
!
filterResult
)
{
this
.
settingHighlighter
.
clear
(
true
);
this
.
filteredMatchesRenderer
.
render
(
null
);
this
.
settingsHeaderRenderer
.
render
(
this
.
preferencesModel
.
settingsGroups
);
this
.
settingsGroupTitleRenderer
.
render
(
this
.
preferencesModel
.
settingsGroups
);
this
.
settingsGroupTitleRenderer
.
showGroup
(
1
);
this
.
editSettingActionRenderer
.
render
(
this
.
preferencesModel
.
settingsGroups
,
this
.
_associatedPreferencesModel
);
}
else
{
this
.
filteredMatchesRenderer
.
render
(
filterResult
);
this
.
settingsHeaderRenderer
.
render
(
filterResult
.
filteredGroups
);
this
.
settingsGroupTitleRenderer
.
render
(
filterResult
.
filteredGroups
);
this
.
settingHighlighter
.
clear
(
true
);
this
.
editSettingActionRenderer
.
render
(
filterResult
.
filteredGroups
,
this
.
_associatedPreferencesModel
);
...
...
@@ -343,6 +347,24 @@ export class StaticContentHidingRenderer extends Disposable implements HiddenAre
}
class
SettingsHeaderRenderer
extends
Disposable
{
private
settingsHeaderWidget
:
SettingsHeaderWidget
;
constructor
(
private
editor
:
ICodeEditor
)
{
super
();
this
.
settingsHeaderWidget
=
this
.
_register
(
new
SettingsHeaderWidget
(
editor
,
nls
.
localize
(
'
defaultSettingsTitle
'
,
"
Default Settings
"
)));
}
public
render
(
settingsGroups
:
ISettingsGroup
[])
{
if
(
settingsGroups
.
length
)
{
this
.
settingsHeaderWidget
.
setMessage
(
nls
.
localize
(
'
defaultSettingsMessage
'
,
"
Place your settings in the file to the right to overwrite.
"
));
}
else
{
this
.
settingsHeaderWidget
.
setMessage
(
nls
.
localize
(
'
noSettingsFound
'
,
"
No Settings Found.
"
));
}
}
}
export
class
SettingsGroupTitleRenderer
extends
Disposable
implements
HiddenAreasProvider
{
private
_onHiddenAreasChanged
:
Emitter
<
void
>
=
new
Emitter
<
void
>
();
...
...
src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts
浏览文件 @
468346df
...
...
@@ -29,6 +29,63 @@ import { Position } from 'vs/editor/common/core/position';
import
{
ICursorPositionChangedEvent
}
from
'
vs/editor/common/controller/cursorEvents
'
;
import
{
buttonBackground
,
buttonForeground
,
badgeForeground
,
badgeBackground
,
contrastBorder
,
errorForeground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
export
class
SettingsHeaderWidget
extends
Widget
implements
IViewZone
{
private
id
:
number
;
private
_domNode
:
HTMLElement
;
private
titleContainer
:
HTMLElement
;
private
messageElement
:
HTMLElement
;
constructor
(
private
editor
:
ICodeEditor
,
private
title
:
string
)
{
super
();
this
.
create
();
this
.
_register
(
this
.
editor
.
onDidChangeConfiguration
(()
=>
this
.
layout
()));
this
.
_register
(
this
.
editor
.
onDidLayoutChange
(()
=>
this
.
layout
()));
}
get
domNode
():
HTMLElement
{
return
this
.
_domNode
;
}
get
heightInLines
():
number
{
return
1
;
}
get
afterLineNumber
():
number
{
return
0
;
}
private
create
()
{
this
.
_domNode
=
DOM
.
$
(
'
.settings-header-widget
'
);
this
.
titleContainer
=
DOM
.
append
(
this
.
_domNode
,
DOM
.
$
(
'
.title-container
'
));
DOM
.
append
(
this
.
titleContainer
,
DOM
.
$
(
'
.title
'
)).
textContent
=
this
.
title
;
this
.
messageElement
=
DOM
.
append
(
this
.
titleContainer
,
DOM
.
$
(
'
.message
'
));
this
.
editor
.
changeViewZones
(
accessor
=>
{
this
.
id
=
accessor
.
addZone
(
this
);
this
.
layout
();
});
}
public
setMessage
(
message
:
string
):
void
{
this
.
messageElement
.
textContent
=
message
;
}
private
layout
():
void
{
const
configuration
=
this
.
editor
.
getConfiguration
();
this
.
titleContainer
.
style
.
fontSize
=
configuration
.
fontInfo
.
fontSize
+
'
px
'
;
}
public
dispose
()
{
this
.
editor
.
changeViewZones
(
accessor
=>
{
accessor
.
removeZone
(
this
.
id
);
});
super
.
dispose
();
}
}
export
class
SettingsGroupTitleWidget
extends
Widget
implements
IViewZone
{
private
id
:
number
;
...
...
src/vs/workbench/parts/preferences/common/preferencesModels.ts
浏览文件 @
468346df
...
...
@@ -643,7 +643,7 @@ export class DefaultSettingsEditorModel extends AbstractSettingsModel implements
lastSetting
=
setting
;
}
}
else
{
this
.
_contentByLines
.
push
(
'
//
No Settings
'
);
this
.
_contentByLines
.
push
(
'
//
'
+
nls
.
localize
(
'
noSettings
'
,
"
No Settings
"
)
);
this
.
_contentByLines
.
push
(
''
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录