提交 5970abcf 编写于 作者: J Johannes Rieken

make use badges, use colors an explorer setting

上级 3023049f
......@@ -34,7 +34,7 @@ export interface IResourceLabel {
export interface IResourceLabelOptions extends IIconLabelOptions {
fileKind?: FileKind;
fileDecorations?: 'mine' | 'all';
fileDecorations?: { useColors: boolean, useBadges: boolean };
}
export class ResourceLabel extends IconLabel {
......@@ -185,11 +185,11 @@ export class ResourceLabel extends IconLabel {
if (this.options && this.options.fileDecorations) {
let deco = this.decorationsService.getTopDecoration(
resource,
this.options.fileDecorations === 'all'
this.options.fileKind !== FileKind.FILE
);
if (deco) {
iconLabelOptions.color = this.themeService.getTheme().getColor(deco.color);
iconLabelOptions.badge = deco.letter && { letter: deco.letter, title: deco.tooltip };
iconLabelOptions.color = this.options.fileDecorations.useColors ? this.themeService.getTheme().getColor(deco.color) : undefined;
iconLabelOptions.badge = this.options.fileDecorations.useBadges ? deco.letter && { letter: deco.letter, title: deco.tooltip } : undefined;
}
}
......
......@@ -355,6 +355,16 @@ configurationRegistry.registerConfiguration({
type: 'boolean',
description: nls.localize('explorer.fileDecorations.enabled', "Controls if the explorer should show file decorations, like SCM status or problems."),
default: true
}
},
'explorer.fileDecorations.useColors': {
type: 'boolean',
description: nls.localize('explorer.fileDecorations.useColors', "Controls if file decorations should use colors."),
default: true
},
'explorer.fileDecorations.useBadges': {
type: 'boolean',
description: nls.localize('explorer.fileDecorations.useBadges', "Controls if file decorations should use badges."),
default: true
},
}
});
......@@ -323,9 +323,7 @@ export class FileRenderer implements IRenderer {
title: stat.nonexistentRoot ? nls.localize('canNotResolve', "Can not resolve folder {0}", stat.resource.toString()) : undefined,
fileKind: stat.isRoot ? FileKind.ROOT_FOLDER : stat.isDirectory ? FileKind.FOLDER : FileKind.FILE,
extraClasses,
fileDecorations: this.configurationService.getConfiguration<IFilesConfiguration>().explorer.fileDecorations.enabled
? stat.isDirectory ? 'all' : 'mine'
: undefined
fileDecorations: this.configurationService.getConfiguration<IFilesConfiguration>().explorer.fileDecorations.enabled ? this.configurationService.getConfiguration<IFilesConfiguration>().explorer.fileDecorations : undefined
});
}
......
......@@ -73,7 +73,8 @@ export interface IFilesConfiguration extends IFilesConfiguration, IWorkbenchEdit
sortOrder: SortOrder;
fileDecorations: {
enabled: boolean;
useColors: boolean;
useBadges: boolean;
};
};
editor: IEditorOptions;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册