From 24ff830c21a043a155b9fc1098fe7b92a15dcb2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moreno?= Date: Wed, 5 Aug 2020 12:21:06 +0200 Subject: [PATCH] fixes #102818 --- .../contrib/scm/browser/scmViewPane.ts | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts index c41a1724859..8853a479809 100644 --- a/src/vs/workbench/contrib/scm/browser/scmViewPane.ts +++ b/src/vs/workbench/contrib/scm/browser/scmViewPane.ts @@ -494,22 +494,12 @@ class ResourceRenderer implements ICompressibleTreeRenderer { + const theme = this.themeService.getColorTheme(); + const icon = iconResource && (theme.type === LIGHT ? iconResource.decorations.icon : iconResource.decorations.iconDark); - if (icon) { - template.decorationIcon.style.display = ''; - template.decorationIcon.style.backgroundImage = `url('${icon}')`; - template.decorationIcon.title = tooltip; - } else { - template.decorationIcon.style.display = 'none'; - template.decorationIcon.style.backgroundImage = ''; - template.decorationIcon.title = ''; - } + template.fileLabel.setFile(uri, { + fileDecorations: { colors: false, badges: !icon }, + hidePath: viewModel.mode === ViewModelMode.Tree, + fileKind, + matches, + descriptionMatches + }); + + if (icon) { + template.decorationIcon.style.display = ''; + template.decorationIcon.style.backgroundImage = `url('${icon}')`; + template.decorationIcon.title = tooltip; + } else { + template.decorationIcon.style.display = 'none'; + template.decorationIcon.style.backgroundImage = ''; + template.decorationIcon.title = ''; + } + }; + + elementDisposables.add(this.themeService.onDidColorThemeChange(render)); + render(); template.element.setAttribute('data-tooltip', tooltip); template.elementDisposables = elementDisposables; -- GitLab