提交 29cccbb9 编写于 作者: J Johannes Rieken

deco - never ending settings tweaks

上级 3d503cb9
......@@ -34,7 +34,7 @@ export interface IResourceLabel {
export interface IResourceLabelOptions extends IIconLabelOptions {
fileKind?: FileKind;
fileDecorations?: { useColors: boolean, useBadges: boolean };
fileDecorations?: { colors: boolean, badges: boolean };
}
export class ResourceLabel extends IconLabel {
......@@ -187,13 +187,15 @@ export class ResourceLabel extends IconLabel {
resource,
this.options.fileKind !== FileKind.FILE
);
if (deco) {
if (deco && this.options.fileDecorations.colors) {
iconLabelOptions.extraClasses.push(deco.labelClasses);
iconLabelOptions.badge = deco.letter ? {
}
if (deco && deco.letter && this.options.fileDecorations.badges) {
iconLabelOptions.badge = {
letter: deco.letter,
title: deco.tooltip,
className: deco.badgeClassName,
} : undefined;
};
}
}
......
......@@ -351,19 +351,14 @@ configurationRegistry.registerConfiguration({
],
'description': nls.localize({ key: 'sortOrder', comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'] }, "Controls sorting order of files and folders in the explorer. In addition to the default sorting, you can set the order to 'mixed' (files and folders sorted combined), 'type' (by file type), 'modified' (by last modified date) or 'filesFirst' (sort files before folders).")
},
'explorer.fileDecorations.enabled': {
'explorer.decorations.colors': {
type: 'boolean',
description: nls.localize('explorer.fileDecorations.enabled', "Controls if the explorer should show file decorations, like SCM status or problems."),
description: nls.localize('explorer.decorations.colors', "Controls if file decorations should use colors."),
default: true
},
'explorer.fileDecorations.useColors': {
'explorer.decorations.badges': {
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."),
description: nls.localize('explorer.decorations.badges', "Controls if file decorations should use badges."),
default: true
},
}
......
......@@ -323,7 +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 ? this.configurationService.getConfiguration<IFilesConfiguration>().explorer.fileDecorations : undefined
fileDecorations: this.configurationService.getConfiguration<IFilesConfiguration>().explorer.decorations
});
}
......
......@@ -71,10 +71,9 @@ export interface IFilesConfiguration extends IFilesConfiguration, IWorkbenchEdit
enableDragAndDrop: boolean;
confirmDelete: boolean;
sortOrder: SortOrder;
fileDecorations: {
enabled: boolean;
useColors: boolean;
useBadges: boolean;
decorations: {
colors: boolean;
badges: boolean;
};
};
editor: IEditorOptions;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册