Skip to content

Commit

Permalink
Fix #46519 - search result count badges should remain left-aligned in…
Browse files Browse the repository at this point in the history
… a narrow search view
  • Loading branch information
roblourens committed Mar 26, 2018
1 parent 0684f8e commit af9dc73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vs/workbench/parts/search/browser/media/searchview.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@
padding: 0;
}

.search-view:not(.wide) .foldermatch .monaco-icon-label,
.search-view:not(.wide) .filematch .monaco-icon-label {
flex: 1;
}

.search-view .monaco-tree .monaco-tree-row:hover:not(.highlighted) .foldermatch .monaco-icon-label,
.search-view .monaco-tree .monaco-tree-row.focused .foldermatch .monaco-icon-label,
.search-view .monaco-tree .monaco-tree-row:hover:not(.highlighted) .filematch .monaco-icon-label,
Expand All @@ -193,8 +198,8 @@
margin-left: 0.8em;
}

.search-view .foldermatch .badge,
.search-view .filematch .badge {
.search-view.wide .foldermatch .badge,
.search-view.wide .filematch .badge {
margin-left: 10px;
}

Expand Down
9 changes: 9 additions & 0 deletions src/vs/workbench/parts/search/browser/searchView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
private static readonly MAX_TEXT_RESULTS = 10000;
private static readonly SHOW_REPLACE_STORAGE_KEY = 'vs.search.show.replace';

private static readonly WIDE_CLASS_NAME = 'wide';
private static readonly WIDE_VIEW_SIZE = 600;

private isDisposed: boolean;

private queryBuilder: QueryBuilder;
Expand Down Expand Up @@ -748,6 +751,12 @@ export class SearchView extends Viewlet implements IViewlet, IPanel {
return;
}

if (this.size.width >= SearchView.WIDE_VIEW_SIZE) {
this.getContainer().addClass(SearchView.WIDE_CLASS_NAME);
} else {
this.getContainer().removeClass(SearchView.WIDE_CLASS_NAME);
}

this.searchWidget.setWidth(this.size.width - 28 /* container margin */);

this.inputPatternIncludes.setWidth(this.size.width - 28 /* container margin */);
Expand Down

0 comments on commit af9dc73

Please sign in to comment.