git extension icon decorations
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#2d883e" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
A
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#9B4F96" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
C
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#682079" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
C
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#B9131A" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
D
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#969696" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
I
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#007ACC" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
M
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#4668C5" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
R
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#6C6C6C" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
U
|
||||||
|
</text>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 431 B |
|
@ -21,6 +21,17 @@ function getIconUri(iconName: string, theme: Theme): Uri {
|
||||||
return Uri.file(path.join(iconsRootPath, themeName, `${iconName}.svg`));
|
return Uri.file(path.join(iconsRootPath, themeName, `${iconName}.svg`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Icons = {
|
||||||
|
Modified: getIconUri('status-modified', Theme.Light),
|
||||||
|
Added: getIconUri('status-added', Theme.Light),
|
||||||
|
Deleted: getIconUri('status-deleted', Theme.Light),
|
||||||
|
Renamed: getIconUri('status-renamed', Theme.Light),
|
||||||
|
Copied: getIconUri('status-copied', Theme.Light),
|
||||||
|
Untracked: getIconUri('status-untracked', Theme.Light),
|
||||||
|
Ignored: getIconUri('status-ignored', Theme.Light),
|
||||||
|
Conflict: getIconUri('status-conflict', Theme.Light),
|
||||||
|
};
|
||||||
|
|
||||||
enum Status {
|
enum Status {
|
||||||
INDEX_MODIFIED,
|
INDEX_MODIFIED,
|
||||||
INDEX_ADDED,
|
INDEX_ADDED,
|
||||||
|
@ -46,21 +57,45 @@ class Resource implements SCMResource {
|
||||||
|
|
||||||
get uri(): Uri { return this._uri; }
|
get uri(): Uri { return this._uri; }
|
||||||
|
|
||||||
get decorations(): SCMResourceDecorations {
|
private get iconPath(): Uri | undefined {
|
||||||
let iconPath: Uri | undefined;
|
|
||||||
let strikeThrough = false;
|
|
||||||
|
|
||||||
switch (this.type) {
|
switch (this.type) {
|
||||||
case Status.MODIFIED:
|
case Status.INDEX_MODIFIED: return Icons.Modified;
|
||||||
iconPath = getIconUri('refresh', Theme.Light);
|
case Status.MODIFIED: return Icons.Modified;
|
||||||
break;
|
case Status.INDEX_ADDED: return Icons.Added;
|
||||||
case Status.DELETED:
|
case Status.INDEX_DELETED: return Icons.Deleted;
|
||||||
iconPath = getIconUri('refresh', Theme.Light);
|
case Status.DELETED: return Icons.Deleted;
|
||||||
strikeThrough = true;
|
case Status.INDEX_RENAMED: return Icons.Renamed;
|
||||||
break;
|
case Status.INDEX_COPIED: return Icons.Copied;
|
||||||
|
case Status.UNTRACKED: return Icons.Untracked;
|
||||||
|
case Status.IGNORED: return Icons.Ignored;
|
||||||
|
case Status.BOTH_DELETED: return Icons.Conflict;
|
||||||
|
case Status.ADDED_BY_US: return Icons.Conflict;
|
||||||
|
case Status.DELETED_BY_THEM: return Icons.Conflict;
|
||||||
|
case Status.ADDED_BY_THEM: return Icons.Conflict;
|
||||||
|
case Status.DELETED_BY_US: return Icons.Conflict;
|
||||||
|
case Status.BOTH_ADDED: return Icons.Conflict;
|
||||||
|
case Status.BOTH_MODIFIED: return Icons.Conflict;
|
||||||
|
default: return void 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return { iconPath, strikeThrough };
|
private get strikeThrough(): boolean {
|
||||||
|
switch (this.type) {
|
||||||
|
case Status.DELETED:
|
||||||
|
case Status.BOTH_DELETED:
|
||||||
|
case Status.DELETED_BY_THEM:
|
||||||
|
case Status.DELETED_BY_US:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
get decorations(): SCMResourceDecorations {
|
||||||
|
return {
|
||||||
|
iconPath: this.iconPath,
|
||||||
|
strikeThrough: this.strikeThrough
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(private _uri: Uri, private type: any) {
|
constructor(private _uri: Uri, private type: any) {
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: 50% 50%;
|
background-position: 50% 50%;
|
||||||
|
margin-right: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.scm-viewlet .monaco-list-row > .resource > .actions .action-label,
|
.scm-viewlet .monaco-list-row > .resource > .actions .action-label,
|
||||||
|
|
|
@ -102,9 +102,9 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
|
||||||
|
|
||||||
renderTemplate(container: HTMLElement): ResourceTemplate {
|
renderTemplate(container: HTMLElement): ResourceTemplate {
|
||||||
const element = append(container, $('.resource'));
|
const element = append(container, $('.resource'));
|
||||||
|
const decorationIcon = append(element, $('.decoration-icon'));
|
||||||
const name = append(element, $('.name'));
|
const name = append(element, $('.name'));
|
||||||
const fileLabel = this.instantiationService.createInstance(FileLabel, name, void 0);
|
const fileLabel = this.instantiationService.createInstance(FileLabel, name, void 0);
|
||||||
const decorationIcon = append(element, $('.decoration-icon'));
|
|
||||||
const actionsContainer = append(element, $('.actions'));
|
const actionsContainer = append(element, $('.actions'));
|
||||||
const actionBar = new ActionBar(actionsContainer, { actionItemProvider: this.actionItemProvider });
|
const actionBar = new ActionBar(actionsContainer, { actionItemProvider: this.actionItemProvider });
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class ResourceRenderer implements IRenderer<ISCMResource, ResourceTemplate> {
|
||||||
if (resource.decorations.icon) {
|
if (resource.decorations.icon) {
|
||||||
template.decorationIcon.style.backgroundImage = `url('${resource.decorations.icon}')`;
|
template.decorationIcon.style.backgroundImage = `url('${resource.decorations.icon}')`;
|
||||||
} else {
|
} else {
|
||||||
delete template.decorationIcon.style.backgroundImage;
|
template.decorationIcon.style.backgroundImage = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|