Skip to content

Commit

Permalink
Implement microsoft#47502
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jul 24, 2018
1 parent 44b3d6f commit 5a3595e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 11 additions & 3 deletions src/vs/workbench/browser/parts/views/customView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
) {
}

Expand Down Expand Up @@ -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'] });
}
Expand Down
6 changes: 0 additions & 6 deletions src/vs/workbench/common/views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,6 @@ export interface ITreeItem {
command?: Command;

children?: ITreeItem[];

decorations?: {
colors: boolean,
badges: boolean
};

}

export interface ITreeViewDataProvider {
Expand Down

0 comments on commit 5a3595e

Please sign in to comment.