Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
95e30b15
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,发现更多精彩内容 >>
提交
95e30b15
编写于
8月 22, 2016
作者:
M
Martin Aeschlimann
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[file icons] support for font icons
上级
d5ec2ccc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
40 addition
and
4 deletion
+40
-4
src/vs/workbench/parts/files/browser/media/explorerviewlet.css
...s/workbench/parts/files/browser/media/explorerviewlet.css
+9
-2
src/vs/workbench/services/themes/electron-browser/themeService.ts
...orkbench/services/themes/electron-browser/themeService.ts
+31
-2
未找到文件。
src/vs/workbench/parts/files/browser/media/explorerviewlet.css
浏览文件 @
95e30b15
...
...
@@ -31,13 +31,20 @@
.explorer-viewlet
.explorer-folders-view.show-file-icons
.folder-icon
::before
,
.explorer-viewlet
.explorer-folders-view.show-file-icons
.file-icon
::before
{
/* svg icons rendered as background image */
background-size
:
16px
;
background-position
:
left
center
;
background-repeat
:
no-repeat
;
padding
:
3px
6px
3px
0
px
;
padding
-right
:
4
px
;
width
:
16px
;
height
:
16
px
;
height
:
22
px
;
display
:
inline-block
;
/* fonts icons */
vertical-align
:
top
;
font-size
:
16px
;
-webkit-font-smoothing
:
antialiased
;
}
.explorer-viewlet
.explorer-open-editors
.monaco-tree
.monaco-tree-row
>
.content
>
.monaco-action-bar
{
...
...
src/vs/workbench/services/themes/electron-browser/themeService.ts
浏览文件 @
95e30b15
...
...
@@ -128,6 +128,9 @@ interface IInternalThemeData extends IThemeData {
interface
FileIconDefinition
{
iconPath
:
string
;
color
:
string
;
content
:
string
;
fontSize
:
string
;
}
interface
FileIconsAssociation
{
...
...
@@ -141,6 +144,7 @@ interface FileIconsAssociation {
interface
FileIconsDocument
extends
FileIconsAssociation
{
iconDefinitions
:
{
[
key
:
string
]:
FileIconDefinition
};
font
:
{
family
:
string
;
weight
:
string
;
style
:
string
;
src
:
{
path
:
string
,
format
:
string
}[]
};
light
?:
FileIconsAssociation
;
highContrast
?:
FileIconsAssociation
;
}
...
...
@@ -447,6 +451,10 @@ function _processFileIconsObject(id: string, fileIconsPath: string, fileIconsDoc
}
let
selectorByDefinitionId
:
{[
def
:
string
]:
string
[]}
=
{};
function
resolvePath
(
path
:
string
)
{
return
Paths
.
join
(
Paths
.
dirname
(
fileIconsPath
),
path
);
}
function
collectSelectors
(
associations
:
FileIconsAssociation
,
baseThemeClassName
?:
string
)
{
function
addSelector
(
selector
:
string
,
defId
:
string
)
{
if
(
defId
)
{
...
...
@@ -494,13 +502,34 @@ function _processFileIconsObject(id: string, fileIconsPath: string, fileIconsDoc
collectSelectors
(
fileIconsDocument
.
highContrast
,
'
.hc_black
'
);
let
cssRules
:
string
[]
=
[];
let
font
=
fileIconsDocument
.
font
;
if
(
font
)
{
let
src
=
font
.
src
.
map
(
l
=>
`url('
${
resolvePath
(
l
.
path
)}
') format('
${
l
.
format
}
')`
).
join
(
'
,
'
);
cssRules
.
push
(
`@font-face { src:
${
src
}
; font-family: '
${
font
.
family
}
'; font-weigth:
${
font
.
weight
}
; font-style:
${
font
.
style
}
; }`
);
cssRules
.
push
(
`.file-icon::before, .folder-icon::before { font-family: '
${
font
.
family
}
';}`
);
}
for
(
let
defId
in
selectorByDefinitionId
)
{
let
selectors
=
selectorByDefinitionId
[
defId
];
let
definition
=
fileIconsDocument
.
iconDefinitions
[
defId
];
if
(
definition
)
{
if
(
definition
.
iconPath
)
{
let
path
=
Paths
.
join
(
Paths
.
dirname
(
fileIconsPath
),
definition
.
iconPath
);
cssRules
.
push
(
`
${
selectors
.
join
(
'
,
'
)}
{ content: ' '; background-image: url("
${
path
}
");}`
);
cssRules
.
push
(
`
${
selectors
.
join
(
'
,
'
)}
{ content: ' '; background-image: url("
${
resolvePath
(
definition
.
iconPath
)}
"); }`
);
}
if
(
definition
.
content
||
definition
.
color
)
{
let
body
=
''
;
if
(
definition
.
color
)
{
body
+=
` color:
${
definition
.
color
}
;`
;
}
if
(
definition
.
content
)
{
body
+=
` content: '
${
definition
.
content
}
';`
;
}
if
(
definition
.
fontSize
)
{
body
+=
` font-size:
${
definition
.
fontSize
}
;`
;
}
cssRules
.
push
(
`
${
selectors
.
join
(
'
,
'
)}
{
${
body
}
}`
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录