Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a0c26c8a
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,发现更多精彩内容 >>
提交
a0c26c8a
编写于
10月 24, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
deco - show badge in scm viewlet when no icons are provided
上级
52a2137d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
99 addition
and
20 deletion
+99
-20
extensions/git/package.json
extensions/git/package.json
+18
-0
extensions/git/src/repository.ts
extensions/git/src/repository.ts
+59
-6
src/vs/workbench/parts/scm/electron-browser/media/scmViewlet.css
...workbench/parts/scm/electron-browser/media/scmViewlet.css
+14
-9
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+8
-5
未找到文件。
extensions/git/package.json
浏览文件 @
a0c26c8a
...
...
@@ -842,6 +842,15 @@
"highContrast"
:
"#E2C08D"
}
},
{
"id"
:
"git.color.deleted"
,
"description"
:
"Color for deleted resources"
,
"defaults"
:
{
"light"
:
"#c02e11"
,
"dark"
:
"#c74e39"
,
"highContrast"
:
"#c74e39"
}
},
{
"id"
:
"git.color.untracked"
,
"description"
:
"Color for untracked resources"
,
...
...
@@ -859,6 +868,15 @@
"dark"
:
"#A7A8A9"
,
"highContrast"
:
"#A7A8A9"
}
},
{
"id"
:
"git.color.conflict"
,
"description"
:
"Color for resources with conflicts"
,
"defaults"
:
{
"light"
:
"#6c6cc4"
,
"dark"
:
"#6c6cc4"
,
"highContrast"
:
"#6c6cc4"
}
}
]
},
...
...
extensions/git/src/repository.ts
浏览文件 @
a0c26c8a
...
...
@@ -171,8 +171,9 @@ export class Resource implements SourceControlResourceState {
}
get
decorations
():
SourceControlResourceDecorations
{
const
light
=
{
iconPath
:
this
.
getIconPath
(
'
light
'
)
};
const
dark
=
{
iconPath
:
this
.
getIconPath
(
'
dark
'
)
};
// TODO@joh
const
light
=
{
iconPath
:
this
.
getIconPath
(
'
light
'
)
}
&&
undefined
;
const
dark
=
{
iconPath
:
this
.
getIconPath
(
'
dark
'
)
}
&&
undefined
;
const
tooltip
=
this
.
tooltip
;
const
strikeThrough
=
this
.
strikeThrough
;
const
faded
=
this
.
faded
;
...
...
@@ -180,19 +181,71 @@ export class Resource implements SourceControlResourceState {
return
{
strikeThrough
,
faded
,
tooltip
,
light
,
dark
};
}
get
resourceDecoration
():
DecorationData
|
undefined
{
const
title
=
this
.
tooltip
;
get
letter
():
string
|
undefined
{
switch
(
this
.
type
)
{
case
Status
.
INDEX_MODIFIED
:
case
Status
.
MODIFIED
:
return
'
M
'
;
case
Status
.
INDEX_ADDED
:
return
'
A
'
;
case
Status
.
INDEX_DELETED
:
case
Status
.
DELETED
:
return
'
D
'
;
case
Status
.
INDEX_RENAMED
:
return
'
R
'
;
case
Status
.
UNTRACKED
:
return
{
priority
:
1
,
title
,
abbreviation
:
localize
(
'
untracked, short
'
,
"
U
"
),
bubble
:
true
,
color
:
new
ThemeColor
(
'
git.color.untracked
'
)
};
return
'
U
'
;
case
Status
.
IGNORED
:
return
'
I
'
;
case
Status
.
INDEX_COPIED
:
case
Status
.
BOTH_DELETED
:
case
Status
.
ADDED_BY_US
:
case
Status
.
DELETED_BY_THEM
:
case
Status
.
ADDED_BY_THEM
:
case
Status
.
DELETED_BY_US
:
case
Status
.
BOTH_ADDED
:
case
Status
.
BOTH_MODIFIED
:
return
'
C
'
;
default
:
return
undefined
;
}
}
get
color
():
ThemeColor
|
undefined
{
switch
(
this
.
type
)
{
case
Status
.
INDEX_MODIFIED
:
case
Status
.
MODIFIED
:
return
{
priority
:
2
,
title
,
abbreviation
:
localize
(
'
modified, short
'
,
"
M
"
),
bubble
:
true
,
color
:
new
ThemeColor
(
'
git.color.modified
'
)
};
return
new
ThemeColor
(
'
git.color.modified
'
);
case
Status
.
INDEX_DELETED
:
case
Status
.
DELETED
:
return
new
ThemeColor
(
'
git.color.deleted
'
);
case
Status
.
INDEX_ADDED
:
// todo@joh - special color?
case
Status
.
INDEX_RENAMED
:
// todo@joh - special color?
case
Status
.
UNTRACKED
:
return
new
ThemeColor
(
'
git.color.untracked
'
);
case
Status
.
IGNORED
:
return
new
ThemeColor
(
'
git.color.ignored
'
);
case
Status
.
INDEX_COPIED
:
case
Status
.
BOTH_DELETED
:
case
Status
.
ADDED_BY_US
:
case
Status
.
DELETED_BY_THEM
:
case
Status
.
ADDED_BY_THEM
:
case
Status
.
DELETED_BY_US
:
case
Status
.
BOTH_ADDED
:
case
Status
.
BOTH_MODIFIED
:
return
new
ThemeColor
(
'
git.color.conflict
'
);
default
:
return
undefined
;
}
}
get
resourceDecoration
():
DecorationData
|
undefined
{
const
title
=
this
.
tooltip
;
const
abbreviation
=
this
.
letter
;
const
color
=
this
.
color
;
return
{
bubble
:
true
,
title
,
abbreviation
,
color
};
}
constructor
(
private
_resourceGroupType
:
ResourceGroupType
,
private
_resourceUri
:
Uri
,
...
...
src/vs/workbench/parts/scm/electron-browser/media/scmViewlet.css
浏览文件 @
a0c26c8a
...
...
@@ -84,9 +84,7 @@
overflow
:
hidden
;
}
.scm-viewlet
.monaco-list-row
>
.resource
>
.name
>
.monaco-icon-label
{
width
:
100%
;
height
:
100%
;
.scm-viewlet
.monaco-list-row
>
.resource
>
.name
>
.monaco-icon-label
>
a
.label-name
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
...
...
@@ -95,6 +93,10 @@
text-decoration
:
line-through
;
}
.scm-viewlet
.monaco-list-row
>
.resource
>
.name
>
.monaco-icon-label
::after
{
padding
:
0
4px
;
}
.scm-viewlet
.monaco-list-row
>
.resource
>
.decoration-icon
{
width
:
16px
;
height
:
100%
;
...
...
@@ -102,23 +104,26 @@
background-position
:
50%
50%
;
}
.scm-viewlet
.monaco-list
.monaco-list-row
>
.resource
>
.name
>
.monaco-icon-label
>
.actions
{
flex-grow
:
100
;
}
.scm-viewlet
.monaco-list
.monaco-list-row
>
.resource-group
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row
>
.resource
>
.actions
{
.scm-viewlet
.monaco-list
.monaco-list-row
>
.resource
>
.
name
>
.monaco-icon-label
>
.
actions
{
display
:
none
;
}
.scm-viewlet
.monaco-list
.monaco-list-row
:hover
>
.resource-group
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row
:hover
>
.resource
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row
:hover
>
.resource
>
.
name
>
.monaco-icon-label
>
.
actions
,
.scm-viewlet
.monaco-list
.monaco-list-row.selected
>
.resource-group
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row.focused
>
.resource-group
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row.selected
>
.resource
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row.focused
>
.resource
>
.actions
,
.scm-viewlet
.monaco-list
.monaco-list-row.selected
>
.resource
>
.
name
>
.monaco-icon-label
>
.
actions
,
.scm-viewlet
.monaco-list
.monaco-list-row.focused
>
.resource
>
.
name
>
.monaco-icon-label
>
.
actions
,
.scm-viewlet
.monaco-list
:not
(
.selection-multiple
)
.monaco-list-row
>
.resource
:hover
>
.actions
{
display
:
block
;
}
.scm-viewlet
.monaco-list-row
>
.resource
>
.actions
.action-label
,
.scm-viewlet
.monaco-list-row
>
.resource
>
.
name
>
.monaco-icon-label
>
.
actions
.action-label
,
.scm-viewlet
.monaco-list-row
>
.resource-group
>
.actions
.action-label
{
width
:
16px
;
height
:
100%
;
...
...
@@ -153,4 +158,4 @@
.scm-viewlet
.spacer
{
flex
:
1
;
}
\ No newline at end of file
}
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
a0c26c8a
...
...
@@ -429,7 +429,7 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
const
element
=
append
(
container
,
$
(
'
.resource
'
));
const
name
=
append
(
element
,
$
(
'
.name
'
));
const
fileLabel
=
this
.
instantiationService
.
createInstance
(
FileLabel
,
name
,
void
0
);
const
actionsContainer
=
append
(
element
,
$
(
'
.actions
'
));
const
actionsContainer
=
append
(
fileLabel
.
element
,
$
(
'
.actions
'
));
const
actionBar
=
new
ActionBar
(
actionsContainer
,
{
actionItemProvider
:
this
.
actionItemProvider
,
actionRunner
:
new
MultipleSelectionActionRunner
(
this
.
getSelectedResources
)
...
...
@@ -446,20 +446,23 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
}
renderElement
(
resource
:
ISCMResource
,
index
:
number
,
template
:
ResourceTemplate
):
void
{
template
.
fileLabel
.
setFile
(
resource
.
sourceUri
);
const
theme
=
this
.
themeService
.
getTheme
();
const
icon
=
theme
.
type
===
LIGHT
?
resource
.
decorations
.
icon
:
resource
.
decorations
.
iconDark
;
template
.
fileLabel
.
setFile
(
resource
.
sourceUri
,
{
fileDecorations
:
{
colors
:
false
,
badges
:
!
icon
}
});
template
.
actionBar
.
clear
();
template
.
actionBar
.
context
=
resource
;
template
.
actionBar
.
push
(
this
.
scmMenus
.
getResourceActions
(
resource
),
{
icon
:
true
,
label
:
false
});
toggleClass
(
template
.
name
,
'
strike-through
'
,
resource
.
decorations
.
strikeThrough
);
toggleClass
(
template
.
element
,
'
faded
'
,
resource
.
decorations
.
faded
);
const
theme
=
this
.
themeService
.
getTheme
();
const
icon
=
theme
.
type
===
LIGHT
?
resource
.
decorations
.
icon
:
resource
.
decorations
.
iconDark
;
if
(
icon
)
{
template
.
decorationIcon
.
style
.
display
=
''
;
template
.
decorationIcon
.
style
.
backgroundImage
=
`url('
${
icon
}
')`
;
template
.
decorationIcon
.
title
=
resource
.
decorations
.
tooltip
;
}
else
{
template
.
decorationIcon
.
style
.
display
=
'
none
'
;
template
.
decorationIcon
.
style
.
backgroundImage
=
''
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录