Skip to content

Commit bbff116

Browse files
committed
Clean up from microsoft#68977 and microsoft#68467 - size all findInputs with css width instead of code
1 parent 2b6eec8 commit bbff116

4 files changed

Lines changed: 1 addition & 28 deletions

File tree

src/vs/base/browser/ui/findinput/findInput.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
width: 100%;
1414
}
1515

16-
.monaco-findInput .monaco-inputbox > .wrapper > .input {
17-
width: 100% !important;
18-
}
19-
2016
.monaco-findInput > .controls {
2117
position: absolute;
2218
top: 3px;

src/vs/base/browser/ui/findinput/findInput.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export class FindInput extends Widget {
4242
static readonly OPTION_CHANGE: string = 'optionChange';
4343

4444
private contextViewProvider: IContextViewProvider;
45-
private width: number;
4645
private placeholder: string;
4746
private validation?: IInputValidator;
4847
private label: string;
@@ -93,7 +92,6 @@ export class FindInput extends Widget {
9392
constructor(parent: HTMLElement | null, contextViewProvider: IContextViewProvider, private readonly _showOptionButtons: boolean, options: IFindInputOptions) {
9493
super();
9594
this.contextViewProvider = contextViewProvider;
96-
this.width = options.width || 100;
9795
this.placeholder = options.placeholder || '';
9896
this.validation = options.validation;
9997
this.label = options.label || NLS_DEFAULT_LABEL;
@@ -159,13 +157,6 @@ export class FindInput extends Widget {
159157
this.focus();
160158
}
161159

162-
public setWidth(newWidth: number): void {
163-
this.width = newWidth;
164-
this.domNode.style.width = this.width + 'px';
165-
this.contextViewProvider.layout();
166-
this.setInputWidth();
167-
}
168-
169160
public getValue(): string {
170161
return this.inputBox.value;
171162
}
@@ -240,7 +231,6 @@ export class FindInput extends Widget {
240231

241232
public setCaseSensitive(value: boolean): void {
242233
this.caseSensitive.checked = value;
243-
this.setInputWidth();
244234
}
245235

246236
public getWholeWords(): boolean {
@@ -249,7 +239,6 @@ export class FindInput extends Widget {
249239

250240
public setWholeWords(value: boolean): void {
251241
this.wholeWords.checked = value;
252-
this.setInputWidth();
253242
}
254243

255244
public getRegex(): boolean {
@@ -258,7 +247,6 @@ export class FindInput extends Widget {
258247

259248
public setRegex(value: boolean): void {
260249
this.regex.checked = value;
261-
this.setInputWidth();
262250
this.validate();
263251
}
264252

@@ -277,15 +265,8 @@ export class FindInput extends Widget {
277265
dom.addClass(this.domNode, 'highlight-' + (this._lastHighlightFindOptions));
278266
}
279267

280-
private setInputWidth(): void {
281-
let w = this.width - this.caseSensitive.width() - this.wholeWords.width() - this.regex.width();
282-
this.inputBox.width = w;
283-
this.inputBox.layout();
284-
}
285-
286268
private buildDomNode(appendCaseSensitiveLabel: string, appendWholeWordsLabel: string, appendRegexLabel: string, history: string[], flexibleHeight: boolean): void {
287269
this.domNode = document.createElement('div');
288-
this.domNode.style.width = this.width + 'px';
289270
dom.addClass(this.domNode, 'monaco-findInput');
290271

291272
this.inputBox = this._register(new HistoryInputBox(this.domNode, this.contextViewProvider, {
@@ -320,7 +301,6 @@ export class FindInput extends Widget {
320301
if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {
321302
this.inputBox.focus();
322303
}
323-
this.setInputWidth();
324304
this.validate();
325305
}));
326306
this._register(this.regex.onKeyDown(e => {
@@ -337,7 +317,6 @@ export class FindInput extends Widget {
337317
if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {
338318
this.inputBox.focus();
339319
}
340-
this.setInputWidth();
341320
this.validate();
342321
}));
343322

@@ -351,7 +330,6 @@ export class FindInput extends Widget {
351330
if (!viaKeyboard && this.fixFocusOnOptionClickEnabled) {
352331
this.inputBox.focus();
353332
}
354-
this.setInputWidth();
355333
this.validate();
356334
}));
357335
this._register(this.caseSensitive.onKeyDown(e => {
@@ -390,7 +368,6 @@ export class FindInput extends Widget {
390368
}
391369
});
392370

393-
this.setInputWidth();
394371

395372
let controls = document.createElement('div');
396373
controls.className = 'controls';

src/vs/workbench/contrib/search/browser/media/searchview.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
.search-view .search-widget .monaco-findInput {
5252
display: inline-block;
5353
vertical-align: middle;
54+
width: 100%;
5455
}
5556

5657
.search-view .search-widget .replace-container {

src/vs/workbench/contrib/search/browser/searchWidget.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ export class SearchWidget extends Widget {
169169
}
170170

171171
setWidth(width: number) {
172-
this.searchInput.setWidth(width);
173172
this.replaceInput.width = width - 28;
174173
this.replaceInput.layout();
175174
}

0 commit comments

Comments
 (0)