Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
dc4e07da
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,发现更多精彩内容 >>
提交
dc4e07da
编写于
6月 27, 2017
作者:
M
Marc Kassay
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added git\src\model tooltip for decorations.
上级
9c24e9a1
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
37 addition
and
3 deletion
+37
-3
extensions/git/src/model.ts
extensions/git/src/model.ts
+24
-1
src/vs/vscode.d.ts
src/vs/vscode.d.ts
+6
-0
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
+2
-1
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-0
src/vs/workbench/api/node/extHostSCM.ts
src/vs/workbench/api/node/extHostSCM.ts
+2
-1
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
+1
-0
src/vs/workbench/services/scm/common/scm.ts
src/vs/workbench/services/scm/common/scm.ts
+1
-0
未找到文件。
extensions/git/src/model.ts
浏览文件 @
dc4e07da
...
...
@@ -119,6 +119,28 @@ export class Resource implements SourceControlResourceState {
}
}
private
getTooltip
():
string
{
switch
(
this
.
type
)
{
case
Status
.
INDEX_MODIFIED
:
return
localize
(
'
index modified
'
,
"
Index Modified
"
);
case
Status
.
MODIFIED
:
return
localize
(
'
modified
'
,
"
Modified
"
);
case
Status
.
INDEX_ADDED
:
return
localize
(
'
index added
'
,
"
Index Added
"
);
case
Status
.
INDEX_DELETED
:
return
localize
(
'
index deleted
'
,
"
Index Deleted
"
);
case
Status
.
DELETED
:
return
localize
(
'
deleted
'
,
"
Deleted
"
);
case
Status
.
INDEX_RENAMED
:
return
localize
(
'
index renamed
'
,
"
Index Renamed
"
);
case
Status
.
INDEX_COPIED
:
return
localize
(
'
index copied
'
,
"
Index Copied
"
);
case
Status
.
UNTRACKED
:
return
localize
(
'
untracked
'
,
"
Untracked
"
);
case
Status
.
IGNORED
:
return
localize
(
'
ignored
'
,
"
Ignored
"
);
case
Status
.
BOTH_DELETED
:
return
localize
(
'
both deleted
'
,
"
Both Deleted
"
);
case
Status
.
ADDED_BY_US
:
return
localize
(
'
added by us
'
,
"
Added By Us
"
);
case
Status
.
DELETED_BY_THEM
:
return
localize
(
'
deleted by them
'
,
"
Deleted By Them
"
);
case
Status
.
ADDED_BY_THEM
:
return
localize
(
'
added by them
'
,
"
Added By Them
"
);
case
Status
.
DELETED_BY_US
:
return
localize
(
'
deleted by us
'
,
"
Deleted By Us
"
);
case
Status
.
BOTH_ADDED
:
return
localize
(
'
both added
'
,
"
Both Added
"
);
case
Status
.
BOTH_MODIFIED
:
return
localize
(
'
both modified
'
,
"
Both Modified
"
);
default
:
return
''
;
}
}
private
get
strikeThrough
():
boolean
{
switch
(
this
.
type
)
{
case
Status
.
DELETED
:
...
...
@@ -141,10 +163,11 @@ export class Resource implements SourceControlResourceState {
get
decorations
():
SourceControlResourceDecorations
{
const
light
=
{
iconPath
:
this
.
getIconPath
(
'
light
'
)
};
const
dark
=
{
iconPath
:
this
.
getIconPath
(
'
dark
'
)
};
const
tooltip
=
this
.
getTooltip
();
const
strikeThrough
=
this
.
strikeThrough
;
const
faded
=
this
.
faded
;
return
{
strikeThrough
,
faded
,
light
,
dark
};
return
{
strikeThrough
,
faded
,
tooltip
,
light
,
dark
};
}
constructor
(
...
...
src/vs/vscode.d.ts
浏览文件 @
dc4e07da
...
...
@@ -4838,6 +4838,12 @@ declare module 'vscode' {
*/
readonly
faded
?:
boolean
;
/**
* The title for a specific
* [source control resource state](#SourceControlResourceState).
*/
readonly
tooltip
?:
string
;
/**
* The light theme decorations.
*/
...
...
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
浏览文件 @
dc4e07da
...
...
@@ -156,12 +156,13 @@ class MainThreadSCMProvider implements ISCMProvider {
}
group
.
resources
=
resources
.
map
(
rawResource
=>
{
const
[
handle
,
sourceUri
,
command
,
icons
,
strikeThrough
,
faded
]
=
rawResource
;
const
[
handle
,
sourceUri
,
command
,
icons
,
tooltip
,
strikeThrough
,
faded
]
=
rawResource
;
const
icon
=
icons
[
0
];
const
iconDark
=
icons
[
1
]
||
icon
;
const
decorations
=
{
icon
:
icon
&&
URI
.
parse
(
icon
),
iconDark
:
iconDark
&&
URI
.
parse
(
iconDark
),
tooltip
,
strikeThrough
,
faded
};
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
dc4e07da
...
...
@@ -324,6 +324,7 @@ export type SCMRawResource = [
string
/*resourceUri*/
,
modes
.
Command
/*command*/
,
string
[]
/*icons: light, dark*/
,
string
/*tooltip*/
,
boolean
/*strike through*/
,
boolean
/*faded*/
];
...
...
src/vs/workbench/api/node/extHostSCM.ts
浏览文件 @
dc4e07da
...
...
@@ -119,10 +119,11 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
icons
.
push
(
darkIconPath
);
}
const
tooltip
=
r
.
decorations
.
tooltip
;
const
strikeThrough
=
r
.
decorations
&&
!!
r
.
decorations
.
strikeThrough
;
const
faded
=
r
.
decorations
&&
!!
r
.
decorations
.
faded
;
return
[
handle
,
sourceUri
,
command
,
icons
,
strikeThrough
,
faded
]
as
SCMRawResource
;
return
[
handle
,
sourceUri
,
command
,
icons
,
tooltip
,
strikeThrough
,
faded
]
as
SCMRawResource
;
});
this
.
_proxy
.
$updateGroupResourceStates
(
this
.
_sourceControlHandle
,
this
.
_handle
,
rawResources
);
...
...
src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts
浏览文件 @
dc4e07da
...
...
@@ -197,6 +197,7 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
if
(
icon
)
{
template
.
decorationIcon
.
style
.
backgroundImage
=
`url('
${
icon
}
')`
;
template
.
decorationIcon
.
title
=
resource
.
decorations
.
tooltip
;
}
else
{
template
.
decorationIcon
.
style
.
backgroundImage
=
''
;
}
...
...
src/vs/workbench/services/scm/common/scm.ts
浏览文件 @
dc4e07da
...
...
@@ -22,6 +22,7 @@ export const DefaultSCMProviderIdStorageKey = 'settings.workspace.scm.defaultPro
export
interface
ISCMResourceDecorations
{
icon
?:
URI
;
iconDark
?:
URI
;
tooltip
?:
string
;
strikeThrough
?:
boolean
;
faded
?:
boolean
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录