Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6111b83c
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,发现更多精彩内容 >>
提交
6111b83c
编写于
10月 12, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use a single letter and render that
上级
6021c19a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
49 deletion
+50
-49
src/vs/base/browser/ui/iconLabel/iconLabel.ts
src/vs/base/browser/ui/iconLabel/iconLabel.ts
+18
-13
src/vs/base/browser/ui/iconLabel/iconlabel.css
src/vs/base/browser/ui/iconLabel/iconlabel.css
+14
-1
src/vs/workbench/browser/labels.ts
src/vs/workbench/browser/labels.ts
+14
-33
src/vs/workbench/parts/scm/electron-browser/scmFileDecorations.ts
...orkbench/parts/scm/electron-browser/scmFileDecorations.ts
+2
-1
src/vs/workbench/services/decorations/browser/decorations.ts
src/vs/workbench/services/decorations/browser/decorations.ts
+2
-1
未找到文件。
src/vs/base/browser/ui/iconLabel/iconLabel.ts
浏览文件 @
6111b83c
...
@@ -25,7 +25,7 @@ export interface IIconLabelOptions {
...
@@ -25,7 +25,7 @@ export interface IIconLabelOptions {
italic
?:
boolean
;
italic
?:
boolean
;
matches
?:
IMatch
[];
matches
?:
IMatch
[];
color
?:
Color
;
color
?:
Color
;
extraIcon
?:
uri
;
badge
?:
{
letter
:
string
,
title
:
string
}
;
}
}
class
FastLabelNode
{
class
FastLabelNode
{
...
@@ -87,6 +87,7 @@ export class IconLabel {
...
@@ -87,6 +87,7 @@ 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
'
)));
...
@@ -147,18 +148,22 @@ export class IconLabel {
...
@@ -147,18 +148,22 @@ export class IconLabel {
this
.
descriptionNode
.
textContent
=
description
||
''
;
this
.
descriptionNode
.
textContent
=
description
||
''
;
this
.
descriptionNode
.
empty
=
!
description
;
this
.
descriptionNode
.
empty
=
!
description
;
if
(
options
&&
options
.
extraIcon
)
{
if
(
options
&&
options
.
badge
)
{
this
.
element
.
style
.
backgroundImage
=
`url("
${
options
.
extraIcon
.
toString
(
true
)}
")`
;
if
(
!
this
.
badgeNode
)
{
this
.
element
.
style
.
backgroundRepeat
=
'
no-repeat
'
;
this
.
badgeNode
=
document
.
createElement
(
'
span
'
);
this
.
element
.
style
.
backgroundPosition
=
'
right center
'
;
this
.
badgeNode
.
className
=
'
label-badge
'
;
this
.
element
.
style
.
paddingRight
=
'
20px
'
;
this
.
badgeNode
.
style
.
backgroundColor
=
options
.
color
.
toString
();
this
.
element
.
style
.
marginRight
=
'
14px
'
;
this
.
badgeNode
.
style
.
color
=
(
options
.
color
.
isDarker
()
?
Color
.
white
:
Color
.
black
).
toString
();
}
else
{
this
.
element
.
style
.
display
=
'
flex
'
;
this
.
element
.
style
.
backgroundImage
=
''
;
this
.
element
.
appendChild
(
this
.
badgeNode
);
this
.
element
.
style
.
backgroundRepeat
=
''
;
}
this
.
element
.
style
.
backgroundPosition
=
''
;
const
{
letter
,
title
}
=
options
.
badge
;
this
.
element
.
style
.
paddingRight
=
''
;
this
.
badgeNode
.
innerHTML
=
letter
;
this
.
element
.
style
.
marginRight
=
''
;
this
.
badgeNode
.
title
=
title
;
dom
.
show
(
this
.
badgeNode
);
}
else
if
(
this
.
badgeNode
)
{
dom
.
hide
(
this
.
badgeNode
);
}
}
}
}
...
...
src/vs/base/browser/ui/iconLabel/iconlabel.css
浏览文件 @
6111b83c
...
@@ -42,4 +42,17 @@
...
@@ -42,4 +42,17 @@
.monaco-icon-label.italic
>
.label-name
,
.monaco-icon-label.italic
>
.label-name
,
.monaco-icon-label.italic
>
.label-description
{
.monaco-icon-label.italic
>
.label-description
{
font-style
:
italic
;
font-style
:
italic
;
}
}
\ No newline at end of file
.monaco-icon-label
>
.label-badge
{
align-self
:
center
;
height
:
12px
;
min-width
:
10px
;
line-height
:
12px
;
font-size
:
80%
;
margin
:
1px
15px
1px
auto
;
padding
:
2px
4px
;
border-radius
:
14px
;
font-weight
:
normal
;
text-align
:
center
;
}
src/vs/workbench/browser/labels.ts
浏览文件 @
6111b83c
...
@@ -25,8 +25,6 @@ import { Schemas } from 'vs/base/common/network';
...
@@ -25,8 +25,6 @@ import { Schemas } from 'vs/base/common/network';
import
{
FileKind
}
from
'
vs/platform/files/common/files
'
;
import
{
FileKind
}
from
'
vs/platform/files/common/files
'
;
import
{
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IModel
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
localize
}
from
'
vs/nls
'
;
export
interface
IResourceLabel
{
export
interface
IResourceLabel
{
name
:
string
;
name
:
string
;
...
@@ -159,60 +157,43 @@ export class ResourceLabel extends IconLabel {
...
@@ -159,60 +157,43 @@ export class ResourceLabel extends IconLabel {
return
;
return
;
}
}
const
iconLabelOptions
:
IIconLabelOptions
=
{
title
:
''
,
italic
:
this
.
options
&&
this
.
options
.
italic
,
matches
:
this
.
options
&&
this
.
options
.
matches
,
};
const
resource
=
this
.
label
.
resource
;
const
resource
=
this
.
label
.
resource
;
let
label
=
this
.
label
.
name
;
let
label
=
this
.
label
.
name
;
let
title
=
''
;
if
(
this
.
options
&&
typeof
this
.
options
.
title
===
'
string
'
)
{
if
(
this
.
options
&&
typeof
this
.
options
.
title
===
'
string
'
)
{
title
=
this
.
options
.
title
;
iconLabelOptions
.
title
=
this
.
options
.
title
;
}
else
if
(
resource
)
{
}
else
if
(
resource
)
{
title
=
getPathLabel
(
resource
,
void
0
,
this
.
environmentService
);
iconLabelOptions
.
title
=
getPathLabel
(
resource
,
void
0
,
this
.
environmentService
);
}
}
if
(
!
this
.
computedIconClasses
)
{
if
(
!
this
.
computedIconClasses
)
{
this
.
computedIconClasses
=
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
resource
,
this
.
options
&&
this
.
options
.
fileKind
);
this
.
computedIconClasses
=
getIconClasses
(
this
.
modelService
,
this
.
modeService
,
resource
,
this
.
options
&&
this
.
options
.
fileKind
);
}
}
let
extraClasses
=
this
.
computedIconClasses
.
slice
(
0
);
iconLabelOptions
.
extraClasses
=
this
.
computedIconClasses
.
slice
(
0
);
if
(
this
.
options
&&
this
.
options
.
extraClasses
)
{
if
(
this
.
options
&&
this
.
options
.
extraClasses
)
{
extraClasses
.
push
(...
this
.
options
.
extraClasses
);
iconLabelOptions
.
extraClasses
.
push
(...
this
.
options
.
extraClasses
);
}
}
const
italic
=
this
.
options
&&
this
.
options
.
italic
;
const
matches
=
this
.
options
&&
this
.
options
.
matches
;
let
color
:
Color
;
let
extraIcon
:
uri
;
if
(
this
.
options
&&
this
.
options
.
fileDecorations
)
{
if
(
this
.
options
&&
this
.
options
.
fileDecorations
)
{
let
deco
=
this
.
decorationsService
.
getTopDecoration
(
let
deco
=
this
.
decorationsService
.
getTopDecoration
(
resource
,
resource
,
this
.
options
.
fileDecorations
===
'
all
'
this
.
options
.
fileDecorations
===
'
all
'
);
);
if
(
deco
)
{
if
(
deco
)
{
color
=
this
.
themeService
.
getTheme
().
getColor
(
deco
.
color
);
iconLabelOptions
.
color
=
this
.
themeService
.
getTheme
().
getColor
(
deco
.
color
);
iconLabelOptions
.
badge
=
deco
.
letter
&&
{
letter
:
deco
.
letter
,
title
:
deco
.
tooltip
};
if
(
deco
.
tooltip
)
{
title
=
localize
(
'
deco.tooltip
'
,
"
{0}, {1}
"
,
title
,
deco
.
tooltip
);
}
if
(
deco
.
icon
)
{
const
{
type
}
=
this
.
themeService
.
getTheme
();
extraIcon
=
type
===
'
light
'
?
deco
.
icon
.
light
:
deco
.
icon
.
dark
;
}
}
}
}
}
this
.
setValue
(
label
,
this
.
label
.
description
,
{
this
.
setValue
(
label
,
this
.
label
.
description
,
iconLabelOptions
);
title
,
extraClasses
,
italic
,
matches
,
color
,
extraIcon
});
}
}
public
dispose
():
void
{
public
dispose
():
void
{
...
...
src/vs/workbench/parts/scm/electron-browser/scmFileDecorations.ts
浏览文件 @
6111b83c
...
@@ -70,7 +70,8 @@ class SCMDecorationsProvider implements IDecorationsProvider {
...
@@ -70,7 +70,8 @@ class SCMDecorationsProvider implements IDecorationsProvider {
severity
:
Severity
.
Info
,
severity
:
Severity
.
Info
,
tooltip
:
localize
(
'
tooltip
'
,
"
{0} - {1}
"
,
resource
.
decorations
.
tooltip
,
this
.
_provider
.
label
),
tooltip
:
localize
(
'
tooltip
'
,
"
{0} - {1}
"
,
resource
.
decorations
.
tooltip
,
this
.
_provider
.
label
),
color
:
this
.
_config
.
fileDecorations
.
useColors
?
resource
.
decorations
.
color
:
undefined
,
color
:
this
.
_config
.
fileDecorations
.
useColors
?
resource
.
decorations
.
color
:
undefined
,
icon
:
this
.
_config
.
fileDecorations
.
useIcons
?
{
light
:
resource
.
decorations
.
icon
,
dark
:
resource
.
decorations
.
iconDark
}
:
undefined
icon
:
this
.
_config
.
fileDecorations
.
useIcons
?
{
light
:
resource
.
decorations
.
icon
,
dark
:
resource
.
decorations
.
iconDark
}
:
undefined
,
letter
:
resource
.
decorations
.
tooltip
.
charAt
(
0
),
};
};
}
}
}
}
...
...
src/vs/workbench/services/decorations/browser/decorations.ts
浏览文件 @
6111b83c
...
@@ -15,8 +15,9 @@ export const IResourceDecorationsService = createDecorator<IResourceDecorationsS
...
@@ -15,8 +15,9 @@ export const IResourceDecorationsService = createDecorator<IResourceDecorationsS
export
interface
IResourceDecoration
{
export
interface
IResourceDecoration
{
readonly
severity
:
Severity
;
readonly
severity
:
Severity
;
readonly
tooltip
?:
string
;
readonly
color
?:
ColorIdentifier
;
readonly
color
?:
ColorIdentifier
;
readonly
letter
?:
string
;
readonly
tooltip
?:
string
;
readonly
icon
?:
{
light
:
URI
,
dark
:
URI
};
readonly
icon
?:
{
light
:
URI
,
dark
:
URI
};
readonly
leafOnly
?:
boolean
;
readonly
leafOnly
?:
boolean
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录