Skip to content

Commit 1b21155

Browse files
committed
files/explorer: use codicons
1 parent 3fd5d4c commit 1b21155

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/vs/workbench/contrib/files/browser/explorerViewlet.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import { WorkbenchStateContext, RemoteNameContext } from 'vs/workbench/browser/c
3838
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
3939
import { AddRootFolderAction, OpenFolderAction, OpenFileFolderAction } from 'vs/workbench/browser/actions/workspaceActions';
4040
import { isMacintosh } from 'vs/base/common/platform';
41+
import { Codicon } from 'vs/base/common/codicons';
4142

4243
export class ExplorerViewletViewsContribution extends Disposable implements IWorkbenchContribution {
4344

@@ -123,7 +124,7 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
123124
return {
124125
id: EmptyView.ID,
125126
name: EmptyView.NAME,
126-
containerIcon: 'codicon-files',
127+
containerIcon: Codicon.files.classNames,
127128
ctorDescriptor: new SyncDescriptor(EmptyView),
128129
order: 1,
129130
canToggleVisibility: true,
@@ -137,7 +138,7 @@ export class ExplorerViewletViewsContribution extends Disposable implements IWor
137138
return {
138139
id: ExplorerView.ID,
139140
name: localize('folders', "Folders"),
140-
containerIcon: 'codicons-files',
141+
containerIcon: Codicon.files.classNames,
141142
ctorDescriptor: new SyncDescriptor(ExplorerView),
142143
order: 1,
143144
canToggleVisibility: false,
@@ -262,7 +263,7 @@ export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry
262263
id: VIEWLET_ID,
263264
name: localize('explore', "Explorer"),
264265
ctorDescriptor: new SyncDescriptor(ExplorerViewPaneContainer),
265-
icon: 'codicon-files',
266+
icon: Codicon.files.classNames,
266267
order: 0
267268
}, ViewContainerLocation.Sidebar);
268269

src/vs/workbench/contrib/files/browser/fileActions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class NewFileAction extends Action {
9797
@ICommandService private commandService: ICommandService
9898
) {
9999
super('explorer.newFile', NEW_FILE_LABEL);
100-
this.class = 'explorer-action codicon-new-file';
100+
this.class = 'explorer-action ' + Codicon.newFile.classNames;
101101
this._register(explorerService.onDidChangeEditable(e => {
102102
const elementIsBeingEdited = explorerService.isEditable(e);
103103
this.enabled = !elementIsBeingEdited;
@@ -119,7 +119,7 @@ export class NewFolderAction extends Action {
119119
@ICommandService private commandService: ICommandService
120120
) {
121121
super('explorer.newFolder', NEW_FOLDER_LABEL);
122-
this.class = 'explorer-action codicon-new-folder';
122+
this.class = 'explorer-action ' + Codicon.newFolder.classNames;
123123
this._register(explorerService.onDidChangeEditable(e => {
124124
const elementIsBeingEdited = explorerService.isEditable(e);
125125
this.enabled = !elementIsBeingEdited;
@@ -670,7 +670,7 @@ export class SaveAllAction extends BaseSaveAllAction {
670670
static readonly LABEL = SAVE_ALL_LABEL;
671671

672672
get class(): string {
673-
return 'explorer-action codicon-save-all';
673+
return 'explorer-action ' + Codicon.saveAll.classNames;
674674
}
675675

676676
protected doRun(): Promise<void> {
@@ -684,7 +684,7 @@ export class SaveAllInGroupAction extends BaseSaveAllAction {
684684
static readonly LABEL = nls.localize('saveAllInGroup', "Save All in Group");
685685

686686
get class(): string {
687-
return 'explorer-action codicon-save-all';
687+
return 'explorer-action ' + Codicon.saveAll.classNames;
688688
}
689689

690690
protected doRun(context: unknown): Promise<void> {
@@ -759,7 +759,7 @@ export class CollapseExplorerView extends Action {
759759
@IViewletService private readonly viewletService: IViewletService,
760760
@IExplorerService readonly explorerService: IExplorerService
761761
) {
762-
super(id, label, 'explorer-action codicon-collapse-all');
762+
super(id, label, 'explorer-action ' + Codicon.collapseAll.classNames);
763763
this._register(explorerService.onDidChangeEditable(e => {
764764
const elementIsBeingEdited = explorerService.isEditable(e);
765765
this.enabled = !elementIsBeingEdited;
@@ -786,7 +786,7 @@ export class RefreshExplorerView extends Action {
786786
@IViewletService private readonly viewletService: IViewletService,
787787
@IExplorerService private readonly explorerService: IExplorerService
788788
) {
789-
super(id, label, 'explorer-action codicon-refresh');
789+
super(id, label, 'explorer-action ' + Codicon.refresh);
790790
this._register(explorerService.onDidChangeEditable(e => {
791791
const elementIsBeingEdited = explorerService.isEditable(e);
792792
this.enabled = !elementIsBeingEdited;

0 commit comments

Comments
 (0)