Skip to content

Commit

Permalink
Support hidesExplorerArrows in Search Tree (#169658)
Browse files Browse the repository at this point in the history
* Support hidesExplorerArrows in Search Tree
Fixes #163822
  • Loading branch information
andreamah committed Dec 20, 2022
1 parent cedb95f commit de7ce5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/vs/workbench/contrib/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { defaultInputBoxStyles, defaultToggleStyles } from 'vs/platform/theme/browser/defaultStyles';
import { diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, editorFindMatchHighlight, editorFindMatchHighlightBorder, foreground, listActiveSelectionForeground, textLinkActiveForeground, textLinkForeground, toolbarActiveBackground, toolbarHoverBackground } from 'vs/platform/theme/common/colorRegistry';
import { isHighContrast } from 'vs/platform/theme/common/theme';
import { IColorTheme, ICssStyleCollector, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';
import { IColorTheme, ICssStyleCollector, IFileIconTheme, IThemeService, registerThemingParticipant, ThemeIcon } from 'vs/platform/theme/common/themeService';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { OpenFileFolderAction, OpenFolderAction } from 'vs/workbench/browser/actions/workspaceActions';
import { ResourceListDnDHandler } from 'vs/workbench/browser/dnd';
Expand Down Expand Up @@ -265,6 +265,7 @@ export class SearchView extends ViewPane {
return;
}
this.isTreeLayoutViewVisible = visible;
this.updateIndentStyles(this.themeService.getFileIconTheme());
this.refreshTree();
}

Expand Down Expand Up @@ -406,6 +407,13 @@ export class SearchView extends ViewPane {
this._register(this.viewModel.searchResult.onChange((event) => this.onSearchResultsChanged(event)));

this._register(this.onDidChangeBodyVisibility(visible => this.onVisibilityChanged(visible)));

this.updateIndentStyles(this.themeService.getFileIconTheme());
this._register(this.themeService.onDidFileIconThemeChange(this.updateIndentStyles, this));
}

private updateIndentStyles(theme: IFileIconTheme): void {
this.resultsElement.classList.toggle('hide-arrows', this.isTreeLayoutViewVisible && theme.hidesExplorerArrows);
}

private onVisibilityChanged(visible: boolean): void {
Expand Down Expand Up @@ -741,7 +749,7 @@ export class SearchView extends ViewPane {
}

private createSearchResultsView(container: HTMLElement): void {
this.resultsElement = dom.append(container, $('.results.show-file-icons'));
this.resultsElement = dom.append(container, $('.results.show-file-icons.file-icon-themable-tree'));
const delegate = this.instantiationService.createInstance(SearchDelegate);

const identityProvider: IIdentityProvider<RenderableMatch> = {
Expand Down

0 comments on commit de7ce5a

Please sign in to comment.