Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b9478c2d
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,发现更多精彩内容 >>
提交
b9478c2d
编写于
10月 24, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
deco - make letter be a after-pseudo element
上级
a7b743e0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
43 deletion
+21
-43
src/vs/base/browser/ui/iconLabel/iconLabel.ts
src/vs/base/browser/ui/iconLabel/iconLabel.ts
+0
-16
src/vs/base/browser/ui/iconLabel/iconlabel.css
src/vs/base/browser/ui/iconLabel/iconlabel.css
+7
-11
src/vs/workbench/browser/labels.ts
src/vs/workbench/browser/labels.ts
+10
-9
src/vs/workbench/services/decorations/browser/decorationsService.ts
...kbench/services/decorations/browser/decorationsService.ts
+4
-7
未找到文件。
src/vs/base/browser/ui/iconLabel/iconLabel.ts
浏览文件 @
b9478c2d
...
@@ -28,7 +28,6 @@ export interface IIconLabelOptions {
...
@@ -28,7 +28,6 @@ export interface IIconLabelOptions {
extraClasses
?:
string
[];
extraClasses
?:
string
[];
italic
?:
boolean
;
italic
?:
boolean
;
matches
?:
IMatch
[];
matches
?:
IMatch
[];
badge
?:
ILabelBadgeOptions
;
}
}
class
FastLabelNode
{
class
FastLabelNode
{
...
@@ -90,7 +89,6 @@ export class IconLabel {
...
@@ -90,7 +89,6 @@ export class IconLabel {
private
domNode
:
FastLabelNode
;
private
domNode
:
FastLabelNode
;
private
labelNode
:
FastLabelNode
|
HighlightedLabel
;
private
labelNode
:
FastLabelNode
|
HighlightedLabel
;
private
descriptionNode
:
FastLabelNode
;
private
descriptionNode
:
FastLabelNode
;
private
badgeNode
:
HTMLSpanElement
;
constructor
(
container
:
HTMLElement
,
options
?:
IIconLabelCreationOptions
)
{
constructor
(
container
:
HTMLElement
,
options
?:
IIconLabelCreationOptions
)
{
this
.
domNode
=
new
FastLabelNode
(
dom
.
append
(
container
,
dom
.
$
(
'
.monaco-icon-label
'
)));
this
.
domNode
=
new
FastLabelNode
(
dom
.
append
(
container
,
dom
.
$
(
'
.monaco-icon-label
'
)));
...
@@ -148,20 +146,6 @@ export class IconLabel {
...
@@ -148,20 +146,6 @@ export class IconLabel {
this
.
descriptionNode
.
textContent
=
description
||
''
;
this
.
descriptionNode
.
textContent
=
description
||
''
;
this
.
descriptionNode
.
empty
=
!
description
;
this
.
descriptionNode
.
empty
=
!
description
;
if
(
options
&&
options
.
badge
)
{
if
(
!
this
.
badgeNode
)
{
this
.
badgeNode
=
document
.
createElement
(
'
span
'
);
this
.
element
.
style
.
display
=
'
flex
'
;
this
.
element
.
appendChild
(
this
.
badgeNode
);
}
this
.
badgeNode
.
title
=
options
.
badge
.
title
;
this
.
badgeNode
.
className
=
`label-badge
${
options
.
badge
.
className
}
`
;
dom
.
show
(
this
.
badgeNode
);
}
else
if
(
this
.
badgeNode
)
{
dom
.
hide
(
this
.
badgeNode
);
}
}
}
public
dispose
():
void
{
public
dispose
():
void
{
...
...
src/vs/base/browser/ui/iconLabel/iconlabel.css
浏览文件 @
b9478c2d
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
/* ---------- Icon label ---------- */
/* ---------- Icon label ---------- */
.monaco-icon-label
{
.monaco-icon-label
{
display
:
inline-block
;
/* required for icons support :before rule */
display
:
flex
;
/* required for icons support :before rule */
overflow
:
hidden
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
}
}
...
@@ -44,15 +44,11 @@
...
@@ -44,15 +44,11 @@
font-style
:
italic
;
font-style
:
italic
;
}
}
.monaco-icon-label
>
.label-badge
{
.monaco-icon-label
::after
{
align-self
:
center
;
flex
:
1
;
height
:
12px
;
opacity
:
0.75
;
min-width
:
10px
;
line-height
:
125%
;
font-size
:
90%
;
font-size
:
90%
;
margin
:
1px
15px
1px
auto
;
font-weight
:
600
;
padding
:
2px
3px
;
text-align
:
right
;
border-radius
:
5px
;
padding
:
0
15px
0
5px
;
font-weight
:
500
;
text-align
:
center
;
}
}
src/vs/workbench/browser/labels.ts
浏览文件 @
b9478c2d
...
@@ -202,15 +202,16 @@ export class ResourceLabel extends IconLabel {
...
@@ -202,15 +202,16 @@ export class ResourceLabel extends IconLabel {
this
.
options
.
fileKind
!==
FileKind
.
FILE
this
.
options
.
fileKind
!==
FileKind
.
FILE
);
);
if
(
deco
&&
this
.
options
.
fileDecorations
.
colors
)
{
if
(
deco
)
{
iconLabelOptions
.
extraClasses
.
push
(
deco
.
labelClassName
);
if
(
deco
.
title
)
{
}
iconLabelOptions
.
title
=
`
${
deco
.
title
}
,
${
iconLabelOptions
.
title
}
`
;
}
if
(
deco
&&
deco
.
badgeClassName
&&
this
.
options
.
fileDecorations
.
badges
)
{
if
(
this
.
options
.
fileDecorations
.
colors
)
{
iconLabelOptions
.
badge
=
{
iconLabelOptions
.
extraClasses
.
push
(
deco
.
labelClassName
);
title
:
deco
.
title
,
}
className
:
deco
.
badgeClassName
,
if
(
this
.
options
.
fileDecorations
.
badges
)
{
};
iconLabelOptions
.
extraClasses
.
push
(
deco
.
badgeClassName
);
}
}
}
}
}
...
...
src/vs/workbench/services/decorations/browser/decorationsService.ts
浏览文件 @
b9478c2d
...
@@ -54,7 +54,7 @@ class DecorationRule {
...
@@ -54,7 +54,7 @@ class DecorationRule {
createCSSRule
(
`.focused .selected .
${
this
.
labelClassName
}
`
,
`color: inherit;`
,
element
);
createCSSRule
(
`.focused .selected .
${
this
.
labelClassName
}
`
,
`color: inherit;`
,
element
);
// letter
// letter
if
(
letter
)
{
if
(
letter
)
{
createCSSRule
(
`.
${
this
.
badgeClassName
}
::
before`
,
`content: "
${
letter
}
"
`
,
element
);
createCSSRule
(
`.
${
this
.
badgeClassName
}
::
after`
,
`content: "
${
letter
}
";
`
,
element
);
}
}
}
}
...
@@ -62,14 +62,11 @@ class DecorationRule {
...
@@ -62,14 +62,11 @@ class DecorationRule {
// label
// label
const
{
color
}
=
data
[
0
];
const
{
color
}
=
data
[
0
];
createCSSRule
(
`.
${
this
.
labelClassName
}
`
,
`color:
${
theme
.
getColor
(
color
)
||
'
inherit
'
}
;`
,
element
);
createCSSRule
(
`.
${
this
.
labelClassName
}
`
,
`color:
${
theme
.
getColor
(
color
)
||
'
inherit
'
}
;`
,
element
);
createCSSRule
(
`.focused .selected .
${
this
.
labelClassName
}
`
,
`color: inherit;
opacity: inherit;
`
,
element
);
createCSSRule
(
`.focused .selected .
${
this
.
labelClassName
}
`
,
`color: inherit;`
,
element
);
// badge
// badge
let
letters
:
string
[]
=
[];
let
content
=
data
.
map
(
d
=>
d
.
letter
).
join
(
'
,
'
);
for
(
const
deco
of
data
)
{
createCSSRule
(
`.
${
this
.
badgeClassName
}
::after`
,
`content: "
${
content
}
";`
,
element
);
letters
.
push
(
deco
.
letter
);
}
createCSSRule
(
`.
${
this
.
badgeClassName
}
::before`
,
`content: "
${
letters
.
join
(
'
,
'
)}
"`
,
element
);
}
}
removeCSSRules
(
element
:
HTMLStyleElement
):
void
{
removeCSSRules
(
element
:
HTMLStyleElement
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录