From 3ce06a35e01c62d0862fa74a5a84f6a00e9b9135 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Tue, 12 Jul 2022 13:47:47 +0200 Subject: [PATCH] `Marked as resolved` marking has poor visibility with high contrast color themes Fixes #149464 --- .../contrib/comments/browser/commentsTreeViewer.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts index 3166fd4719579..020ef7eb4d1e5 100644 --- a/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts +++ b/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts @@ -188,9 +188,21 @@ export class CommentNodeRenderer implements IListRenderer return renderedComment; } + private getIcon(commentCount: number, threadState?: CommentThreadState): Codicon { + if (threadState === CommentThreadState.Unresolved) { + return Codicon.commentUnresolved; + } else if (commentCount === 1) { + return Codicon.comment; + } else { + return Codicon.commentDiscussion; + } + } + renderElement(node: ITreeNode, index: number, templateData: ICommentThreadTemplateData, height: number | undefined): void { const commentCount = node.element.replies.length + 1; - templateData.threadMetadata.icon?.classList.add(...ThemeIcon.asClassNameArray((commentCount === 1) ? Codicon.comment : Codicon.commentDiscussion)); + templateData.threadMetadata.icon.classList.remove(...Array.from(templateData.threadMetadata.icon.classList.values()) + .filter(value => value.startsWith('codicon'))); + templateData.threadMetadata.icon.classList.add(...ThemeIcon.asClassNameArray(this.getIcon(commentCount, node.element.threadState))); if (node.element.threadState !== undefined) { const color = this.getCommentThreadWidgetStateColor(node.element.threadState, this.themeService.getColorTheme()); templateData.threadMetadata.icon.style.setProperty(commentViewThreadStateColorVar, `${color}`);