提交 6b413891 编写于 作者: A Alex Ross

Change themeColor to color in ThemeIcon api

Fixes #109459
上级 22f848ed
......@@ -25,7 +25,7 @@ export function themeColorFromId(id: ColorIdentifier) {
// theme icon
export interface ThemeIcon {
readonly id: string;
readonly themeColor?: ThemeColor;
readonly color?: ThemeColor;
}
export namespace ThemeIcon {
......
......@@ -816,7 +816,7 @@ declare module 'vscode' {
/**
* The optional ThemeColor of the icon. The color is currently only used in [TreeItem](#TreeItem).
*/
readonly themeColor?: ThemeColor;
readonly color?: ThemeColor;
/**
* Creates a reference to a theme icon.
......
......@@ -2181,11 +2181,11 @@ export class ThemeIcon {
static Folder: ThemeIcon;
readonly id: string;
readonly themeColor?: ThemeColor;
readonly color?: ThemeColor;
constructor(id: string, color?: ThemeColor) {
this.id = id;
this.themeColor = color;
this.color = color;
}
}
ThemeIcon.File = new ThemeIcon('file');
......
......@@ -845,8 +845,8 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
let iconClass: string | undefined;
if (node.themeIcon && !this.isFileKindThemeIcon(node.themeIcon)) {
iconClass = ThemeIcon.asClassName(node.themeIcon);
if (node.themeIcon.themeColor) {
templateData.icon.style.color = this.themeService.getColorTheme().getColor(node.themeIcon.themeColor.id)?.toString() ?? '';
if (node.themeIcon.color) {
templateData.icon.style.color = this.themeService.getColorTheme().getColor(node.themeIcon.color.id)?.toString() ?? '';
}
}
templateData.icon.className = iconClass ? `custom-view-tree-node-item-icon ${iconClass}` : '';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册