Skip to content

Commit

Permalink
Marked as resolved marking has poor visibility with high contrast c…
Browse files Browse the repository at this point in the history
…olor themes (#154921)

Fixes #149464
  • Loading branch information
alexr00 authored and andreamah committed Jul 14, 2022
1 parent 6125804 commit 8f0041f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/vs/workbench/contrib/comments/browser/commentsTreeViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,21 @@ export class CommentNodeRenderer implements IListRenderer<ITreeNode<CommentNode>
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<CommentNode>, 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}`);
Expand Down

0 comments on commit 8f0041f

Please sign in to comment.