From 5a3595e291413dbc2991c408cc3777ef5ca11fa8 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 24 Jul 2018 14:45:45 +0200 Subject: [PATCH] Implement #47502 --- src/vs/workbench/browser/parts/views/customView.ts | 14 +++++++++++--- src/vs/workbench/common/views.ts | 6 ------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 48a034e299e..bf04ef7a0c0 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -202,12 +202,18 @@ export class CustomTreeViewer extends Disposable implements ITreeViewer { @IExtensionService private extensionService: IExtensionService, @IWorkbenchThemeService private themeService: IWorkbenchThemeService, @IInstantiationService private instantiationService: IInstantiationService, - @ICommandService private commandService: ICommandService + @ICommandService private commandService: ICommandService, + @IConfigurationService private configurationService: IConfigurationService ) { super(); this.root = new Root(); this._register(this.themeService.onDidFileIconThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/)); this._register(this.themeService.onThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/)); + this._register(this.configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration('explorer.decorations')) { + this.doRefresh([this.root]); /** soft refresh **/ + } + })); } get dataProvider(): ITreeViewDataProvider { @@ -458,7 +464,8 @@ class TreeRenderer implements IRenderer { private menus: TreeMenus, private actionItemProvider: IActionItemProvider, @IInstantiationService private instantiationService: IInstantiationService, - @IWorkbenchThemeService private themeService: IWorkbenchThemeService + @IWorkbenchThemeService private themeService: IWorkbenchThemeService, + @IConfigurationService private configurationService: IConfigurationService, ) { } @@ -496,7 +503,8 @@ class TreeRenderer implements IRenderer { templateData.actionBar.clear(); if ((resource || node.themeIcon) && !icon) { - templateData.resourceLabel.setLabel({ name: label, resource: resource ? resource : URI.parse('_icon_resource') }, { fileKind: this.getFileKind(node), title, fileDecorations: node.decorations, extraClasses: ['custom-view-tree-node-item-resourceLabel'] }); + const fileDecorations = this.configurationService.getValue<{ colors: boolean, badges: boolean }>('explorer.decorations'); + templateData.resourceLabel.setLabel({ name: label, resource: resource ? resource : URI.parse('_icon_resource') }, { fileKind: this.getFileKind(node), title, fileDecorations: fileDecorations, extraClasses: ['custom-view-tree-node-item-resourceLabel'] }); } else { templateData.resourceLabel.setLabel({ name: label }, { title, hideIcon: true, extraClasses: ['custom-view-tree-node-item-resourceLabel'] }); } diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 0a1bee98c3c..b1049fab080 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -288,12 +288,6 @@ export interface ITreeItem { command?: Command; children?: ITreeItem[]; - - decorations?: { - colors: boolean, - badges: boolean - }; - } export interface ITreeViewDataProvider { -- GitLab