Skip to content

Commit cca20eb

Browse files
committed
Revert "API proposal for tree item icon color"
This reverts commit 52e557f.
1 parent cc899f1 commit cca20eb

4 files changed

Lines changed: 2 additions & 19 deletions

File tree

src/vs/vscode.proposed.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,11 +1025,6 @@ declare module 'vscode' {
10251025
*/
10261026
tooltip?: string | MarkdownString | /* for compilation */ any;
10271027

1028-
/**
1029-
* When `iconPath` is a [ThemeColor](#ThemeColor) `iconColor` will be used to set the color of the icon.
1030-
*/
1031-
iconColor?: ThemeColor;
1032-
10331028
/**
10341029
* @param label Label describing this item
10351030
* @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None)

src/vs/workbench/api/common/extHostTreeViews.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ExtHostTreeViewsShape, MainThreadTreeViewsShape } from './extHost.proto
1313
import { ITreeItem, TreeViewItemHandleArg, ITreeItemLabel, IRevealOptions } from 'vs/workbench/common/views';
1414
import { ExtHostCommands, CommandsConverter } from 'vs/workbench/api/common/extHostCommands';
1515
import { asPromise } from 'vs/base/common/async';
16-
import { TreeItemCollapsibleState, ThemeIcon, MarkdownString as MarkdownStringType, ThemeColor } from 'vs/workbench/api/common/extHostTypes';
16+
import { TreeItemCollapsibleState, ThemeIcon, MarkdownString as MarkdownStringType } from 'vs/workbench/api/common/extHostTypes';
1717
import { isUndefinedOrNull, isString } from 'vs/base/common/types';
1818
import { equals, coalesce } from 'vs/base/common/arrays';
1919
import { ILogService } from 'vs/platform/log/common/log';
@@ -550,7 +550,6 @@ class ExtHostTreeView<T> extends Disposable {
550550
icon,
551551
iconDark: this.getDarkIconPath(extensionTreeItem) || icon,
552552
themeIcon: extensionTreeItem.iconPath instanceof ThemeIcon ? { id: extensionTreeItem.iconPath.id } : undefined,
553-
iconColor: this.getIconColor(extensionTreeItem),
554553
collapsibleState: isUndefinedOrNull(extensionTreeItem.collapsibleState) ? TreeItemCollapsibleState.None : extensionTreeItem.collapsibleState,
555554
accessibilityInformation: extensionTreeItem.accessibilityInformation
556555
};
@@ -564,11 +563,6 @@ class ExtHostTreeView<T> extends Disposable {
564563
};
565564
}
566565

567-
private getIconColor(extensionTreeItem: vscode.TreeItem2): ThemeColor | undefined {
568-
checkProposedApiEnabled(this.extension);
569-
return (extensionTreeItem.iconPath instanceof ThemeIcon) ? <ThemeColor>extensionTreeItem.iconColor : undefined;
570-
}
571-
572566
private createHandle(element: T, { id, label, resourceUri }: vscode.TreeItem, parent: TreeNode | Root, returnFirst?: boolean): TreeItemHandle {
573567
if (id) {
574568
return `${ExtHostTreeView.ID_HANDLE_PREFIX}/${id}`;

src/vs/workbench/common/views.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { RawContextKey, ContextKeyExpression } from 'vs/platform/contextkey/comm
1010
import { localize } from 'vs/nls';
1111
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
1212
import { IDisposable, Disposable, toDisposable } from 'vs/base/common/lifecycle';
13-
import { ThemeColor, ThemeIcon } from 'vs/platform/theme/common/themeService';
13+
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
1414
import { getOrSet } from 'vs/base/common/map';
1515
import { Registry } from 'vs/platform/registry/common/platform';
1616
import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry';
@@ -644,8 +644,6 @@ export interface ITreeItem {
644644

645645
themeIcon?: ThemeIcon;
646646

647-
iconColor?: ThemeColor;
648-
649647
resourceUri?: UriComponents;
650648

651649
tooltip?: string | IMarkdownString;
@@ -668,7 +666,6 @@ export class ResolvableTreeItem implements ITreeItem {
668666
icon?: UriComponents;
669667
iconDark?: UriComponents;
670668
themeIcon?: ThemeIcon;
671-
iconColor?: ThemeColor;
672669
resourceUri?: UriComponents;
673670
tooltip?: string | IMarkdownString;
674671
contextValue?: string;

src/vs/workbench/contrib/views/browser/treeView.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -793,9 +793,6 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
793793
let iconClass: string | undefined;
794794
if (node.themeIcon && !this.isFileKindThemeIcon(node.themeIcon)) {
795795
iconClass = ThemeIcon.asClassName(node.themeIcon);
796-
if (node.iconColor) {
797-
templateData.icon.style.color = this.themeService.getColorTheme().getColor(node.iconColor.id)?.toString() ?? '';
798-
}
799796
}
800797
templateData.icon.className = iconClass ? `custom-view-tree-node-item-icon ${iconClass}` : '';
801798
templateData.icon.style.backgroundImage = '';

0 commit comments

Comments
 (0)