Skip to content

Commit

Permalink
Fix settings search text flowing under result count
Browse files Browse the repository at this point in the history
Fix #78063
  • Loading branch information
roblourens committed Jul 28, 2019
1 parent 2cfc817 commit 3802a98
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ export class SettingsEditor2 extends BaseEditor {

private tocFocusedElement: SettingsTreeGroupElement | null;
private settingsTreeScrollTop = 0;
private dimension: DOM.Dimension;

constructor(
@ITelemetryService telemetryService: ITelemetryService,
Expand Down Expand Up @@ -279,10 +280,11 @@ export class SettingsEditor2 extends BaseEditor {
}

layout(dimension: DOM.Dimension): void {
this.dimension = dimension;
this.layoutTrees(dimension);

const innerWidth = dimension.width - 24 * 2; // 24px padding on left and right
const monacoWidth = (innerWidth > 1000 ? 1000 : innerWidth) - 10;
const innerWidth = Math.min(1000, dimension.width) - 24 * 2; // 24px padding on left and right;
const monacoWidth = innerWidth - 10 - this.countElement.clientWidth - 12; // minus padding inside inputbox, countElement width, extra padding before countElement
this.searchWidget.layout({ height: 20, width: monacoWidth });

DOM.toggleClass(this.rootElement, 'mid-width', dimension.width < 1000 && dimension.width >= 600);
Expand Down Expand Up @@ -1231,7 +1233,11 @@ export class SettingsEditor2 extends BaseEditor {
: 'none';

if (!this.searchResultModel) {
this.countElement.style.display = 'none';
if (this.countElement.style.display !== 'none') {
this.countElement.style.display = 'none';
this.layout(this.dimension);
}

DOM.removeClass(this.rootElement, 'no-results');
return;
}
Expand All @@ -1244,7 +1250,10 @@ export class SettingsEditor2 extends BaseEditor {
default: this.countElement.innerText = localize('moreThanOneResult', "{0} Settings Found", count);
}

this.countElement.style.display = 'block';
if (this.countElement.style.display !== 'block') {
this.countElement.style.display = 'block';
this.layout(this.dimension);
}
DOM.toggleClass(this.rootElement, 'no-results', count === 0);
}
}
Expand Down

0 comments on commit 3802a98

Please sign in to comment.