Skip to content

Commit 92e6f89

Browse files
committed
Support file icons in explorer
1 parent f253f94 commit 92e6f89

4 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/vs/workbench/parts/files/browser/files.contribution.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@ configurationRegistry.registerConfiguration({
256256
'type': 'boolean',
257257
'description': nls.localize('enableDragAndDrop', "Controls if the explorer should allow to move files and folders via drag and drop."),
258258
'default': true
259+
},
260+
'explorer.fileIcons': {
261+
'type': 'boolean',
262+
'description': nls.localize('fileIcons', "Controls if the explorer shows icons for files and folders. The actual icon set is controled with the 'files.iconSet' setting."),
263+
'default': false
259264
}
260265
}
261266
});

src/vs/workbench/parts/files/browser/views/explorerView.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ export class ExplorerView extends CollapsibleViewletView {
199199
private onConfigurationUpdated(configuration: IFilesConfiguration, refresh?: boolean): void {
200200
this.autoReveal = configuration && configuration.explorer && configuration.explorer.autoReveal;
201201

202+
let showFileIcons = configuration && configuration.explorer && configuration.explorer.fileIcons;
203+
DOM.toggleClass(this.treeContainer, 'show-file-icons', showFileIcons);
204+
202205
// Push down config updates to components of viewer
203206
let needsRefresh = false;
204207
if (this.filter) {

src/vs/workbench/parts/files/browser/views/explorerViewer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ export class FileRenderer extends ActionsRenderer implements IRenderer {
341341
return 'folder-icon';
342342
}
343343

344-
return 'text-file-icon';
344+
return 'file-icon';
345345
}
346346
}
347347

src/vs/workbench/parts/files/common/files.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export interface IFilesConfiguration extends IFilesConfiguration, IWorkbenchEdit
6868
};
6969
autoReveal: boolean;
7070
enableDragAndDrop: boolean;
71+
fileIcons: boolean;
7172
};
7273
editor: IEditorOptions;
7374
}

0 commit comments

Comments
 (0)