Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support hidesExplorerArrows in Search Tree #169658

Merged
merged 2 commits into from Dec 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/vs/workbench/contrib/search/browser/searchView.ts
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