提交 28ee527b 编写于 作者: M Martin Aeschlimann 提交者: GitHub

Merge pull request #35856 from tam5/hide-explorer-arrows

allow hiding explorer arrows via icon theme
...@@ -106,6 +106,10 @@ ...@@ -106,6 +106,10 @@
background-image: url("collapsed-hc.svg"); background-image: url("collapsed-hc.svg");
} }
.explorer-folders-view.hide-arrows .monaco-tree-row .content::before {
background-image: none;
}
.explorer-viewlet .explorer-open-editors .monaco-tree .monaco-tree-row:hover > .content .monaco-action-bar, .explorer-viewlet .explorer-open-editors .monaco-tree .monaco-tree-row:hover > .content .monaco-action-bar,
.explorer-viewlet .explorer-open-editors .monaco-tree.focused .monaco-tree-row.focused > .content .monaco-action-bar, .explorer-viewlet .explorer-open-editors .monaco-tree.focused .monaco-tree-row.focused > .content .monaco-action-bar,
.explorer-viewlet .explorer-open-editors .monaco-tree .monaco-tree-row > .content.dirty > .monaco-action-bar { .explorer-viewlet .explorer-open-editors .monaco-tree .monaco-tree-row > .content.dirty > .monaco-action-bar {
......
...@@ -161,6 +161,7 @@ export class ExplorerView extends ViewsViewletPanel { ...@@ -161,6 +161,7 @@ export class ExplorerView extends ViewsViewletPanel {
const onFileIconThemeChange = (fileIconTheme: IFileIconTheme) => { const onFileIconThemeChange = (fileIconTheme: IFileIconTheme) => {
DOM.toggleClass(this.treeContainer, 'align-icons-and-twisties', fileIconTheme.hasFileIcons && !fileIconTheme.hasFolderIcons); DOM.toggleClass(this.treeContainer, 'align-icons-and-twisties', fileIconTheme.hasFileIcons && !fileIconTheme.hasFolderIcons);
DOM.toggleClass(this.treeContainer, 'hide-arrows', fileIconTheme.hidesExplorerArrows);
}; };
this.disposables.push(this.themeService.onDidFileIconThemeChange(onFileIconThemeChange)); this.disposables.push(this.themeService.onDidFileIconThemeChange(onFileIconThemeChange));
......
...@@ -47,6 +47,7 @@ export interface IFileIconTheme { ...@@ -47,6 +47,7 @@ export interface IFileIconTheme {
readonly isLoaded: boolean; readonly isLoaded: boolean;
readonly hasFileIcons?: boolean; readonly hasFileIcons?: boolean;
readonly hasFolderIcons?: boolean; readonly hasFolderIcons?: boolean;
readonly hidesExplorerArrows?: boolean;
} }
export interface IWorkbenchThemeService extends IThemeService { export interface IWorkbenchThemeService extends IThemeService {
......
...@@ -21,6 +21,7 @@ export class FileIconThemeData implements IFileIconTheme { ...@@ -21,6 +21,7 @@ export class FileIconThemeData implements IFileIconTheme {
description?: string; description?: string;
hasFileIcons?: boolean; hasFileIcons?: boolean;
hasFolderIcons?: boolean; hasFolderIcons?: boolean;
hidesExplorerArrows?: boolean;
isLoaded: boolean; isLoaded: boolean;
path?: string; path?: string;
extensionData: ExtensionData; extensionData: ExtensionData;
...@@ -38,6 +39,7 @@ export class FileIconThemeData implements IFileIconTheme { ...@@ -38,6 +39,7 @@ export class FileIconThemeData implements IFileIconTheme {
this.styleSheetContent = result.content; this.styleSheetContent = result.content;
this.hasFileIcons = result.hasFileIcons; this.hasFileIcons = result.hasFileIcons;
this.hasFolderIcons = result.hasFolderIcons; this.hasFolderIcons = result.hasFolderIcons;
this.hidesExplorerArrows = result.hidesExplorerArrows;
this.isLoaded = true; this.isLoaded = true;
return this.styleSheetContent; return this.styleSheetContent;
}); });
...@@ -69,6 +71,7 @@ export class FileIconThemeData implements IFileIconTheme { ...@@ -69,6 +71,7 @@ export class FileIconThemeData implements IFileIconTheme {
themeData.settingsId = null; themeData.settingsId = null;
themeData.hasFileIcons = false; themeData.hasFileIcons = false;
themeData.hasFolderIcons = false; themeData.hasFolderIcons = false;
themeData.hidesExplorerArrows = false;
themeData.isLoaded = true; themeData.isLoaded = true;
themeData.extensionData = null; themeData.extensionData = null;
} }
...@@ -110,6 +113,7 @@ interface IconThemeDocument extends IconsAssociation { ...@@ -110,6 +113,7 @@ interface IconThemeDocument extends IconsAssociation {
fonts: FontDefinition[]; fonts: FontDefinition[];
light?: IconsAssociation; light?: IconsAssociation;
highContrast?: IconsAssociation; highContrast?: IconsAssociation;
hidesExplorerArrows?: boolean;
} }
function _loadIconThemeDocument(fileSetPath: string): TPromise<IconThemeDocument> { function _loadIconThemeDocument(fileSetPath: string): TPromise<IconThemeDocument> {
...@@ -123,9 +127,9 @@ function _loadIconThemeDocument(fileSetPath: string): TPromise<IconThemeDocument ...@@ -123,9 +127,9 @@ function _loadIconThemeDocument(fileSetPath: string): TPromise<IconThemeDocument
}); });
} }
function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, iconThemeDocument: IconThemeDocument): { content: string; hasFileIcons: boolean; hasFolderIcons: boolean; } { function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, iconThemeDocument: IconThemeDocument): { content: string; hasFileIcons: boolean; hasFolderIcons: boolean; hidesExplorerArrows: boolean; } {
let result = { content: '', hasFileIcons: false, hasFolderIcons: false }; let result = { content: '', hasFileIcons: false, hasFolderIcons: false, hidesExplorerArrows: false };
if (!iconThemeDocument.iconDefinitions) { if (!iconThemeDocument.iconDefinitions) {
return result; return result;
...@@ -247,6 +251,10 @@ function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, ic ...@@ -247,6 +251,10 @@ function _processIconThemeDocument(id: string, iconThemeDocumentPath: string, ic
return result; return result;
} }
if (iconThemeDocument.hidesExplorerArrows) {
result.hidesExplorerArrows = true;
}
let cssRules: string[] = []; let cssRules: string[] = [];
let fonts = iconThemeDocument.fonts; let fonts = iconThemeDocument.fonts;
......
...@@ -118,6 +118,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { ...@@ -118,6 +118,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
isLoaded: false, isLoaded: false,
hasFileIcons: false, hasFileIcons: false,
hasFolderIcons: false, hasFolderIcons: false,
hidesExplorerArrows: false,
extensionData: null extensionData: null
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册