Skip to content

Commit 29cccbb

Browse files
committed
deco - never ending settings tweaks
1 parent 3d503cb commit 29cccbb

4 files changed

Lines changed: 14 additions & 18 deletions

File tree

src/vs/workbench/browser/labels.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface IResourceLabel {
3434

3535
export interface IResourceLabelOptions extends IIconLabelOptions {
3636
fileKind?: FileKind;
37-
fileDecorations?: { useColors: boolean, useBadges: boolean };
37+
fileDecorations?: { colors: boolean, badges: boolean };
3838
}
3939

4040
export class ResourceLabel extends IconLabel {
@@ -187,13 +187,15 @@ export class ResourceLabel extends IconLabel {
187187
resource,
188188
this.options.fileKind !== FileKind.FILE
189189
);
190-
if (deco) {
190+
if (deco && this.options.fileDecorations.colors) {
191191
iconLabelOptions.extraClasses.push(deco.labelClasses);
192-
iconLabelOptions.badge = deco.letter ? {
192+
}
193+
if (deco && deco.letter && this.options.fileDecorations.badges) {
194+
iconLabelOptions.badge = {
193195
letter: deco.letter,
194196
title: deco.tooltip,
195197
className: deco.badgeClassName,
196-
} : undefined;
198+
};
197199
}
198200
}
199201

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,19 +351,14 @@ configurationRegistry.registerConfiguration({
351351
],
352352
'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).")
353353
},
354-
'explorer.fileDecorations.enabled': {
354+
'explorer.decorations.colors': {
355355
type: 'boolean',
356-
description: nls.localize('explorer.fileDecorations.enabled', "Controls if the explorer should show file decorations, like SCM status or problems."),
356+
description: nls.localize('explorer.decorations.colors', "Controls if file decorations should use colors."),
357357
default: true
358358
},
359-
'explorer.fileDecorations.useColors': {
359+
'explorer.decorations.badges': {
360360
type: 'boolean',
361-
description: nls.localize('explorer.fileDecorations.useColors', "Controls if file decorations should use colors."),
362-
default: true
363-
},
364-
'explorer.fileDecorations.useBadges': {
365-
type: 'boolean',
366-
description: nls.localize('explorer.fileDecorations.useBadges', "Controls if file decorations should use badges."),
361+
description: nls.localize('explorer.decorations.badges', "Controls if file decorations should use badges."),
367362
default: true
368363
},
369364
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export class FileRenderer implements IRenderer {
323323
title: stat.nonexistentRoot ? nls.localize('canNotResolve', "Can not resolve folder {0}", stat.resource.toString()) : undefined,
324324
fileKind: stat.isRoot ? FileKind.ROOT_FOLDER : stat.isDirectory ? FileKind.FOLDER : FileKind.FILE,
325325
extraClasses,
326-
fileDecorations: this.configurationService.getConfiguration<IFilesConfiguration>().explorer.fileDecorations.enabled ? this.configurationService.getConfiguration<IFilesConfiguration>().explorer.fileDecorations : undefined
326+
fileDecorations: this.configurationService.getConfiguration<IFilesConfiguration>().explorer.decorations
327327
});
328328
}
329329

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,9 @@ export interface IFilesConfiguration extends IFilesConfiguration, IWorkbenchEdit
7171
enableDragAndDrop: boolean;
7272
confirmDelete: boolean;
7373
sortOrder: SortOrder;
74-
fileDecorations: {
75-
enabled: boolean;
76-
useColors: boolean;
77-
useBadges: boolean;
74+
decorations: {
75+
colors: boolean;
76+
badges: boolean;
7877
};
7978
};
8079
editor: IEditorOptions;

0 commit comments

Comments
 (0)