diff --git a/src/vs/platform/search/common/search.ts b/src/vs/platform/search/common/search.ts index 275c7daeb4680a5219638578cf0dffb93af6bea9..08e09a63d8b4157c97ba2ef16b1eb548271a0231 100644 --- a/src/vs/platform/search/common/search.ts +++ b/src/vs/platform/search/common/search.ts @@ -333,7 +333,6 @@ export interface ISearchConfigurationProperties { useReplacePreview: boolean; showLineNumbers: boolean; usePCRE2: boolean; - actionsPosition: 'auto' | 'right'; } export interface ISearchConfiguration extends IFilesConfiguration { diff --git a/src/vs/workbench/parts/search/browser/media/searchview.css b/src/vs/workbench/parts/search/browser/media/searchview.css index 2ea4ccf2b6f528822fa8c763b37e1c207639d688..1805429faba0d31404b6bce740b17f6ca5be0166 100644 --- a/src/vs/workbench/parts/search/browser/media/searchview.css +++ b/src/vs/workbench/parts/search/browser/media/searchview.css @@ -197,6 +197,18 @@ padding: 0; } +.search-view:not(.wide) .foldermatch .monaco-icon-label, +.search-view:not(.wide) .filematch .monaco-icon-label { + flex: 1; +} + +.search-view:not(.wide) .monaco-tree .monaco-tree-row:hover:not(.highlighted) .foldermatch .monaco-icon-label, +.search-view:not(.wide) .monaco-tree .monaco-tree-row.focused .foldermatch .monaco-icon-label, +.search-view:not(.wide) .monaco-tree .monaco-tree-row:hover:not(.highlighted) .filematch .monaco-icon-label, +.search-view:not(.wide) .monaco-tree .monaco-tree-row.focused .filematch .monaco-icon-label { + flex: 1; +} + .search-view .foldermatch .directory, .search-view .filematch .directory { opacity: 0.7; @@ -204,8 +216,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; } @@ -252,11 +264,15 @@ .search-view .monaco-tree .monaco-tree-row:hover:not(.highlighted) .monaco-action-bar, .search-view .monaco-tree .monaco-tree-row.focused .monaco-action-bar { - display: block; + display: inline-block; +} + +.search-view:not(.wide) .monaco-tree .monaco-tree-row .linematch .actionBarContainer { + flex: 1; } .search-view:not(.wide) .monaco-tree .monaco-tree-row .monaco-action-bar { - flex: 1 0 auto; + float: right; } .search-view .monaco-tree .monaco-tree-row .monaco-action-bar .action-label { @@ -308,7 +324,7 @@ .search-view > .results > .monaco-tree .monaco-tree-row.focused .content .filematch .monaco-count-badge, .search-view > .results > .monaco-tree .monaco-tree-row.focused .content .foldermatch .monaco-count-badge, .search-view > .results > .monaco-tree .monaco-tree-row.focused .content .linematch .monaco-count-badge { - margin-right: 0; + display: none; } .search-view .focused .monaco-tree-row.selected:not(.highlighted) > .content.actions .action-remove, diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index cbba0a97400345bc3e420e080a350c01a20f679c..e70eaf83b0bd10cac2eb89d1617e851df5e80349 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -235,7 +235,8 @@ export class SearchRenderer extends Disposable implements IRenderer { const replace = DOM.append(parent, DOM.$('span.replaceMatch')); const after = DOM.append(parent, DOM.$('span')); const lineNumber = DOM.append(container, DOM.$('span.matchLineNum')); - const actions = new ActionBar(container, { animated: false }); + const actionBarContainer = DOM.append(container, DOM.$('span.actionBarContainer')); + const actions = new ActionBar(actionBarContainer, { animated: false }); return { parent, diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index d4038d4e81faa150e04c32da77ec1587cfaa0fa0..511d2c559e7807a98740d0aeb0a7219bffc4e4f5 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -32,7 +32,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/listService'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { IProgressService } from 'vs/platform/progress/common/progress'; -import { IPatternInfo, ISearchComplete, ISearchConfiguration, ISearchHistoryService, ISearchHistoryValues, ISearchProgressItem, ITextQuery, VIEW_ID, SearchErrorCode, ISearchConfigurationProperties } from 'vs/platform/search/common/search'; +import { IPatternInfo, ISearchComplete, ISearchConfiguration, ISearchHistoryService, ISearchHistoryValues, ISearchProgressItem, ITextQuery, VIEW_ID, SearchErrorCode } from 'vs/platform/search/common/search'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { diffInserted, diffInsertedOutline, diffRemoved, diffRemovedOutline, editorFindMatchHighlight, editorFindMatchHighlightBorder, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; @@ -784,9 +784,11 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { return; } - const actionsPosition = this.configurationService.getValue('search').actionsPosition; - const useWideLayout = this.size.width >= SearchView.WIDE_VIEW_SIZE && actionsPosition === 'auto'; - dom.toggleClass(this.getContainer(), SearchView.WIDE_CLASS_NAME, useWideLayout); + if (this.size.width >= SearchView.WIDE_VIEW_SIZE) { + dom.addClass(this.getContainer(), SearchView.WIDE_CLASS_NAME); + } else { + dom.removeClass(this.getContainer(), SearchView.WIDE_CLASS_NAME); + } this.searchWidget.setWidth(this.size.width - 28 /* container margin */); diff --git a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts index 4c306b4acdf730ff894ffa24541e11aaabd2b311..b38067dd9f36597b4a44db13a41e4a680cffc7c1 100644 --- a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts @@ -674,16 +674,6 @@ configurationRegistry.registerConfiguration({ type: 'boolean', default: false, description: nls.localize('search.usePCRE2', "Whether to use the PCRE2 regex engine in text search. This enables using some advanced regex features like lookbehind and backreferences. However, not all PCRE2 features are supported - only features that are also supported by JavaScript.") - }, - 'search.actionsPosition': { - type: 'string', - enum: ['auto', 'right'], - enumDescriptions: [ - nls.localize('search.actionsPositionAuto', "Position the actionbar to the right when the search view is narrow, and immediately after the content when the search view is wide."), - nls.localize('search.actionsPositionRight', "Always position the actionbar to the right."), - ], - default: 'auto', - description: nls.localize('search.actionsPosition', "Controls the positioning of the actionbar on rows in the search view.") } } });