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

Fix #42097

上级 d55c88f8
......@@ -20,10 +20,17 @@
content: ' ';
}
.file-icon-themable-tree.align-icons-and-twisties .monaco-tree-row:not(.has-children) .content::before {
.file-icon-themable-tree.align-icons-and-twisties .monaco-tree-row:not(.has-children) .content::before,
.file-icon-themable-tree.hide-arrows .monaco-tree-row .content::before {
display: none;
}
/** Show the twistie content if the parent has opt in icon **/
.tree-explorer-viewlet-tree-view.file-icon-themable-tree.align-icons-and-twisties .monaco-tree-row:not(.has-children) .content.parent-has-icon::before,
.tree-explorer-viewlet-tree-view.file-icon-themable-tree.hide-arrows .monaco-tree-row .content.parent-has-icon::before {
display: inline-block;
}
.file-icon-themable-tree .monaco-tree-row.has-children.expanded .content::before {
background-image: url("expanded.svg");
}
......@@ -49,10 +56,6 @@
background-image: url("collapsed-hc.svg");
}
.file-icon-themable-tree.hide-arrows .monaco-tree-row .content::before {
display: none;
}
.tree-explorer-viewlet-tree-view .monaco-tree .monaco-tree-row .custom-view-tree-node-item {
display: flex;
height: 22px;
......
......@@ -262,6 +262,7 @@ class TreeDataSource implements IDataSource {
}
interface ITreeExplorerTemplateData {
container: HTMLElement;
label: HTMLElement;
resourceLabel: ResourceLabel;
icon: HTMLElement;
......@@ -300,14 +301,13 @@ class TreeRenderer implements IRenderer {
actionRunner: new MultipleSelectionActionRunner(() => tree.getSelection())
});
return { label, resourceLabel, icon, actionBar };
return { container, label, resourceLabel, icon, actionBar };
}
public renderElement(tree: ITree, node: ITreeItem, templateId: string, templateData: ITreeExplorerTemplateData): void {
const resource = node.resourceUri ? URI.revive(node.resourceUri) : null;
const name = node.label || basename(resource.path);
const theme = this.themeService.getTheme();
const icon = theme.type === LIGHT ? node.icon : node.iconDark;
const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark;
// reset
templateData.resourceLabel.clear();
......@@ -331,6 +331,14 @@ class TreeRenderer implements IRenderer {
templateData.actionBar.context = (<TreeViewItemHandleArg>{ $treeViewId: this.treeViewId, $treeItemHandle: node.handle });
templateData.actionBar.push(this.menus.getResourceActions(node), { icon: true, label: false });
// Fix when the theme do not show folder icons but parent has opt in icon.
DOM.toggleClass(templateData.container, 'parent-has-icon', this.hasParentHasOptInIcon(node, tree));
}
private hasParentHasOptInIcon(node: ITreeItem, tree: ITree): boolean {
const parent: ITreeItem = tree.getNavigator(node).parent();
return parent ? !!(this.themeService.getTheme().type === LIGHT ? parent.icon : parent.iconDark) : false;
}
public disposeTemplate(tree: ITree, templateId: string, templateData: ITreeExplorerTemplateData): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册