Skip to content

Commit

Permalink
Merge pull request microsoft#244 from daiyam/feat-customicon
Browse files Browse the repository at this point in the history
  • Loading branch information
lostintangent authored Jun 11, 2022
2 parents 14aae1a + 97f6f53 commit f289e4a
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/player/tree/nodes.ts
Original file line number Diff line number Diff line change
@@ -112,6 +112,27 @@ export class CodeTourStepNode extends TreeItem {
} else if (progress.isComplete(tour, stepNumber)) {
// @ts-ignore
this.iconPath = completeIcon;
} else if (step.icon) {
if (step.icon.startsWith('.')) {
const resourceRoot = workspaceRoot
? workspaceRoot
: getWorkspaceUri(tour);

this.iconPath = getFileUri(step.icon, resourceRoot);
} else {
try {
const uri = Uri.parse(step.icon, true);

this.iconPath = uri;
} catch {
const data = step.icon.split(',');
if (data.length > 1) {
this.iconPath = new ThemeIcon(data[0], new ThemeColor(data[1]));
} else {
this.iconPath = new ThemeIcon(data[0]);
}
}
}
} else if (step.directory) {
this.iconPath = ThemeIcon.Folder;
} else {
1 change: 1 addition & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ export interface CodeTourStepPosition {
export interface CodeTourStep {
title?: string;
description: string;
icon?: string;

// If any of the following are set, then only
// one of them can be, since these properties

0 comments on commit f289e4a

Please sign in to comment.