Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
03432806
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,发现更多精彩内容 >>
提交
03432806
编写于
8月 28, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use URIs for custom view item's icons
上级
a3b6f18a
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
11 addition
and
10 deletion
+11
-10
src/vs/workbench/api/node/extHostTreeViews.ts
src/vs/workbench/api/node/extHostTreeViews.ts
+5
-5
src/vs/workbench/browser/parts/views/customView.ts
src/vs/workbench/browser/parts/views/customView.ts
+4
-3
src/vs/workbench/common/views.ts
src/vs/workbench/common/views.ts
+2
-2
未找到文件。
src/vs/workbench/api/node/extHostTreeViews.ts
浏览文件 @
03432806
...
...
@@ -426,7 +426,7 @@ class ExtHostTreeView<T> extends Disposable {
return
handle
;
}
private
getLightIconPath
(
extensionTreeItem
:
vscode
.
TreeItem
):
string
{
private
getLightIconPath
(
extensionTreeItem
:
vscode
.
TreeItem
):
URI
{
if
(
extensionTreeItem
.
iconPath
&&
!
(
extensionTreeItem
.
iconPath
instanceof
ThemeIcon
))
{
if
(
typeof
extensionTreeItem
.
iconPath
===
'
string
'
||
extensionTreeItem
.
iconPath
instanceof
URI
)
{
...
...
@@ -437,18 +437,18 @@ class ExtHostTreeView<T> extends Disposable {
return
void
0
;
}
private
getDarkIconPath
(
extensionTreeItem
:
vscode
.
TreeItem
):
string
{
private
getDarkIconPath
(
extensionTreeItem
:
vscode
.
TreeItem
):
URI
{
if
(
extensionTreeItem
.
iconPath
&&
!
(
extensionTreeItem
.
iconPath
instanceof
ThemeIcon
)
&&
extensionTreeItem
.
iconPath
[
'
dark
'
])
{
return
this
.
getIconPath
(
extensionTreeItem
.
iconPath
[
'
dark
'
]);
}
return
void
0
;
}
private
getIconPath
(
iconPath
:
string
|
URI
):
string
{
private
getIconPath
(
iconPath
:
string
|
URI
):
URI
{
if
(
iconPath
instanceof
URI
)
{
return
iconPath
.
toString
()
;
return
iconPath
;
}
return
URI
.
file
(
iconPath
)
.
toString
()
;
return
URI
.
file
(
iconPath
);
}
private
addNodeToCache
(
element
:
T
,
node
:
TreeNode
):
void
{
...
...
src/vs/workbench/browser/parts/views/customView.ts
浏览文件 @
03432806
...
...
@@ -496,6 +496,7 @@ class TreeRenderer implements IRenderer {
const
resource
=
node
.
resourceUri
?
URI
.
revive
(
node
.
resourceUri
)
:
null
;
const
label
=
node
.
label
?
node
.
label
:
resource
?
basename
(
resource
.
path
)
:
''
;
const
icon
=
this
.
themeService
.
getTheme
().
type
===
LIGHT
?
node
.
icon
:
node
.
iconDark
;
const
iconUrl
=
icon
?
URI
.
revive
(
icon
)
:
null
;
const
title
=
node
.
tooltip
?
node
.
tooltip
:
resource
?
void
0
:
label
;
// reset
...
...
@@ -504,13 +505,13 @@ class TreeRenderer implements IRenderer {
if
(
resource
||
node
.
themeIcon
)
{
const
fileDecorations
=
this
.
configurationService
.
getValue
<
{
colors
:
boolean
,
badges
:
boolean
}
>
(
'
explorer.decorations
'
);
templateData
.
resourceLabel
.
setLabel
({
name
:
label
,
resource
:
resource
?
resource
:
URI
.
parse
(
'
missing:_icon_resource
'
)
},
{
fileKind
:
this
.
getFileKind
(
node
),
title
,
hideIcon
:
!!
icon
,
fileDecorations
,
extraClasses
:
[
'
custom-view-tree-node-item-resourceLabel
'
]
});
templateData
.
resourceLabel
.
setLabel
({
name
:
label
,
resource
:
resource
?
resource
:
URI
.
parse
(
'
missing:_icon_resource
'
)
},
{
fileKind
:
this
.
getFileKind
(
node
),
title
,
hideIcon
:
!!
icon
Url
,
fileDecorations
,
extraClasses
:
[
'
custom-view-tree-node-item-resourceLabel
'
]
});
}
else
{
templateData
.
resourceLabel
.
setLabel
({
name
:
label
},
{
title
,
hideIcon
:
true
,
extraClasses
:
[
'
custom-view-tree-node-item-resourceLabel
'
]
});
}
templateData
.
icon
.
style
.
backgroundImage
=
icon
?
`url('
${
icon
}
')`
:
''
;
DOM
.
toggleClass
(
templateData
.
icon
,
'
custom-view-tree-node-item-icon
'
,
!!
icon
);
templateData
.
icon
.
style
.
backgroundImage
=
icon
Url
?
`url('
${
iconUrl
}
')`
:
''
;
DOM
.
toggleClass
(
templateData
.
icon
,
'
custom-view-tree-node-item-icon
'
,
!!
icon
Url
);
templateData
.
actionBar
.
context
=
(
<
TreeViewItemHandleArg
>
{
$treeViewId
:
this
.
treeViewId
,
$treeItemHandle
:
node
.
handle
});
templateData
.
actionBar
.
push
(
this
.
menus
.
getResourceActions
(
node
),
{
icon
:
true
,
label
:
false
});
...
...
src/vs/workbench/common/views.ts
浏览文件 @
03432806
...
...
@@ -273,9 +273,9 @@ export interface ITreeItem {
label
?:
string
;
icon
?:
string
;
icon
?:
UriComponents
;
iconDark
?:
string
;
iconDark
?:
UriComponents
;
themeIcon
?:
ThemeIcon
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录