提交 ac9ceddd 编写于 作者: S Sandeep Somavarapu

Fix #30333

上级 0bf86665
......@@ -31,6 +31,7 @@ import { IExtensionService } from 'vs/platform/extensions/common/extensions';
import { CollapsibleState, ViewSizing } from 'vs/base/browser/ui/splitview/splitview';
import { CollapsibleView, IViewletViewOptions, IViewOptions } from 'vs/workbench/parts/views/browser/views';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IWorkbenchThemeService } from "vs/workbench/services/themes/common/workbenchThemeService";
export class TreeView extends CollapsibleView {
......@@ -51,6 +52,7 @@ export class TreeView extends CollapsibleView {
@IInstantiationService private instantiationService: IInstantiationService,
@IListService private listService: IListService,
@IThemeService private themeService: IThemeService,
@IWorkbenchThemeService private workbenchThemeService: IWorkbenchThemeService,
@IContextKeyService private contextKeyService: IContextKeyService,
@IExtensionService private extensionService: IExtensionService,
@ICommandService private commandService: ICommandService
......@@ -60,6 +62,7 @@ export class TreeView extends CollapsibleView {
this.viewFocusContext = this.contextKeyService.createKey<boolean>(this.id, void 0);
this.menus.onDidChangeTitle(() => this.updateActions(), this, this.disposables);
this.themeService.onThemeChange(() => this.tree.refresh() /* soft refresh */, this, this.disposables);
this.workbenchThemeService.onDidFileIconThemeChange(() => this.tree.refresh() /* soft refresh */, this, this.disposables);
if (!options.collapsed) {
this.activate();
}
......@@ -262,7 +265,8 @@ class TreeRenderer implements IRenderer {
private static ITEM_HEIGHT = 22;
private static TREE_TEMPLATE_ID = 'treeExplorer';
constructor( @IThemeService private themeService: IThemeService) {
constructor( @IThemeService private themeService: IThemeService,
@IWorkbenchThemeService private workbenchThemeService: IWorkbenchThemeService) {
}
public getHeight(tree: ITree, element: any): number {
......@@ -289,7 +293,8 @@ class TreeRenderer implements IRenderer {
templateData.label.text(node.label).title(node.label);
const theme = this.themeService.getTheme();
const icon = theme.type === LIGHT ? node.icon : node.iconDark;
const fileIconTheme = this.workbenchThemeService.getFileIconTheme();
const icon = (fileIconTheme.hasFileIcons || fileIconTheme.hasFolderIcons) ? (theme.type === LIGHT ? node.icon : node.iconDark) : null;
if (icon) {
templateData.icon.getHTMLElement().style.backgroundImage = `url('${icon}')`;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册