Skip to content

Commit

Permalink
Update npm scripts explorer to use codicons (ref #90911)
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Solorio committed Mar 5, 2020
1 parent 599043c commit 573fe9e
Show file tree
Hide file tree
Showing 15 changed files with 14 additions and 61 deletions.
15 changes: 3 additions & 12 deletions extensions/npm/package.json
Expand Up @@ -57,18 +57,12 @@
{
"command": "npm.runScript",
"title": "%command.run%",
"icon": {
"light": "resources/light/continue.svg",
"dark": "resources/dark/continue.svg"
}
"icon": "$(run)"
},
{
"command": "npm.debugScript",
"title": "%command.debug%",
"icon": {
"light": "resources/light/debug.svg",
"dark": "resources/dark/debug.svg"
}
"icon": "$(debug)"
},
{
"command": "npm.openScript",
Expand All @@ -81,10 +75,7 @@
{
"command": "npm.refresh",
"title": "%command.refresh%",
"icon": {
"light": "resources/light/refresh.svg",
"dark": "resources/dark/refresh.svg"
}
"icon": "$(refresh)"
},
{
"command": "npm.runSelectedScript",
Expand Down
3 changes: 0 additions & 3 deletions extensions/npm/resources/dark/continue.svg

This file was deleted.

5 changes: 0 additions & 5 deletions extensions/npm/resources/dark/debug.svg

This file was deleted.

5 changes: 0 additions & 5 deletions extensions/npm/resources/dark/prepostscript.svg

This file was deleted.

4 changes: 0 additions & 4 deletions extensions/npm/resources/dark/refresh.svg

This file was deleted.

3 changes: 0 additions & 3 deletions extensions/npm/resources/dark/script.svg

This file was deleted.

3 changes: 0 additions & 3 deletions extensions/npm/resources/light/continue.svg

This file was deleted.

5 changes: 0 additions & 5 deletions extensions/npm/resources/light/debug.svg

This file was deleted.

5 changes: 0 additions & 5 deletions extensions/npm/resources/light/prepostscript.svg

This file was deleted.

4 changes: 0 additions & 4 deletions extensions/npm/resources/light/refresh.svg

This file was deleted.

3 changes: 0 additions & 3 deletions extensions/npm/resources/light/script.svg

This file was deleted.

12 changes: 3 additions & 9 deletions extensions/npm/src/npmView.ts
Expand Up @@ -73,7 +73,7 @@ class NpmScript extends TreeItem {
task: Task;
package: PackageJSON;

constructor(context: ExtensionContext, packageJson: PackageJSON, task: Task) {
constructor(_context: ExtensionContext, packageJson: PackageJSON, task: Task) {
super(task.name, TreeItemCollapsibleState.None);
const command: ExplorerCommands = workspace.getConfiguration('npm').get<ExplorerCommands>('scriptExplorerAction') || 'open';

Expand All @@ -98,15 +98,9 @@ class NpmScript extends TreeItem {
this.command = commandList[command];

if (task.group && task.group === TaskGroup.Clean) {
this.iconPath = {
light: context.asAbsolutePath(path.join('resources', 'light', 'prepostscript.svg')),
dark: context.asAbsolutePath(path.join('resources', 'dark', 'prepostscript.svg'))
};
this.iconPath = new ThemeIcon('wrench-subaction');
} else {
this.iconPath = {
light: context.asAbsolutePath(path.join('resources', 'light', 'script.svg')),
dark: context.asAbsolutePath(path.join('resources', 'dark', 'script.svg'))
};
this.iconPath = new ThemeIcon('wrench');
}
if (task.detail) {
this.tooltip = task.detail;
Expand Down
@@ -0,0 +1,3 @@
.codicon-wrench-subaction {
opacity: 0.5;
}
1 change: 1 addition & 0 deletions src/vs/base/browser/ui/codiconLabel/codiconLabel.ts
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import 'vs/css!./codicon/codicon';
import 'vs/css!./codicon/codicon-modifications';
import 'vs/css!./codicon/codicon-animations';
import { escape } from 'vs/base/common/strings';
import { renderCodicons } from 'vs/base/common/codicons';
Expand Down
4 changes: 4 additions & 0 deletions src/vs/workbench/browser/parts/views/media/views.css
Expand Up @@ -141,6 +141,10 @@
margin-top: 3px;
}

.customview-tree .monaco-list .monaco-list-row.selected .custom-view-tree-node-item > .custom-view-tree-node-item-icon.codicon {
color: currentColor !important;
}

.customview-tree .monaco-list .monaco-list-row .custom-view-tree-node-item .custom-view-tree-node-item-resourceLabel .monaco-icon-label-container > .monaco-icon-name-container {
flex: 1;
}
Expand Down

0 comments on commit 573fe9e

Please sign in to comment.