From 29cccbb9cbb6ce95bef97e3871d6060f005f48a6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 12 Oct 2017 18:28:21 +0200 Subject: [PATCH] deco - never ending settings tweaks --- src/vs/workbench/browser/labels.ts | 10 ++++++---- .../parts/files/browser/files.contribution.ts | 13 ++++--------- .../parts/files/browser/views/explorerViewer.ts | 2 +- src/vs/workbench/parts/files/common/files.ts | 7 +++---- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 44862848b46..255348a5218 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -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; + }; } } diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index c9afa393d06..878dea1810b 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -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 }, } diff --git a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts index d1bfd069259..b82590980a9 100644 --- a/src/vs/workbench/parts/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/browser/views/explorerViewer.ts @@ -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().explorer.fileDecorations.enabled ? this.configurationService.getConfiguration().explorer.fileDecorations : undefined + fileDecorations: this.configurationService.getConfiguration().explorer.decorations }); } diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index c77f34767ba..e63b3e56b59 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -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; -- GitLab