diff --git a/terminus-terminal/src/components/searchPanel.component.pug b/terminus-terminal/src/components/searchPanel.component.pug index 1fedf756..d8077ab7 100644 --- a/terminus-terminal/src/components/searchPanel.component.pug +++ b/terminus-terminal/src/components/searchPanel.component.pug @@ -1,36 +1,51 @@ -.input-group.w-100 - input.search-input.form-control( - type='search', - [(ngModel)]='query', - (ngModelChange)='onQueryChange()', - [class.text-danger]='notFound', - (click)='$event.stopPropagation()', - (keyup.enter)='findNext()', - (keyup.esc)='close.emit()', - placeholder='Search...' - ) - .input-group-append - .input-group-text - a( - (click)='options.caseSensitive = !options.caseSensitive', - [class.text-info]='options.caseSensitive', - ngbTooltip='Case sensitivity', - placement='bottom' - ) - i.fa.fa-fw.fa-font - a( - (click)='options.regex = !options.regex', - [class.text-info]='options.regex', - ngbTooltip='Regular expression', - placement='bottom' - ) - i.fa.fa-fw.fa-asterisk - a( - (click)='options.wholeWord = !options.wholeWord', - [class.text-info]='options.wholeWord', - ngbTooltip='Whole word', - placement='bottom' - ) - i.fa.fa-fw.fa-text-width +input.search-input.form-control( + type='search', + [(ngModel)]='query', + (ngModelChange)='onQueryChange()', + [class.text-danger]='notFound', + (click)='$event.stopPropagation()', + (keyup.enter)='findPrevious()', + (keyup.esc)='close.emit()', + placeholder='Search...' +) + +button.btn.btn-link( + (click)='findPrevious()', + ngbTooltip='Next', + placement='bottom' +) + i.fa.fa-fw.fa-arrow-up + +button.btn.btn-link( + (click)='findNext()', + ngbTooltip='Next', + placement='bottom' +) + i.fa.fa-fw.fa-arrow-down + +.mr-2 + +button.btn.btn-link( + (click)='options.caseSensitive = !options.caseSensitive', + [class.active]='options.caseSensitive', + ngbTooltip='Case sensitivity', + placement='bottom' +) + i.fa.fa-fw.fa-font + +button.btn.btn-link( + (click)='options.regex = !options.regex', + [class.active]='options.regex', + ngbTooltip='Regular expression', + placement='bottom' +) + i.fa.fa-fw.fa-asterisk +button.btn.btn-link( + (click)='options.wholeWord = !options.wholeWord', + [class.active]='options.wholeWord', + ngbTooltip='Whole word', + placement='bottom' +) + i.fa.fa-fw.fa-text-width button.close.text-light.pl-3.pr-2((click)='close.emit()') × diff --git a/terminus-terminal/src/components/searchPanel.component.scss b/terminus-terminal/src/components/searchPanel.component.scss index b89634e3..38e16942 100644 --- a/terminus-terminal/src/components/searchPanel.component.scss +++ b/terminus-terminal/src/components/searchPanel.component.scss @@ -5,16 +5,13 @@ z-index: 5; padding: 10px; border-radius: 0 0 3px 3px; - background: rgba(0, 0, 0, .75); + background: rgba(0, 0, 0, .95); border: 1px solid rgba(0, 0, 0, .5); border-top: 0; display: flex; - a { - padding-left: 10px; - - &:first-child { - padding-left: 0; - } + button { + padding: 0 6px; + flex-shrink: 0; } } diff --git a/terminus-terminal/src/components/searchPanel.component.ts b/terminus-terminal/src/components/searchPanel.component.ts index f07cdd61..2e9a8dae 100644 --- a/terminus-terminal/src/components/searchPanel.component.ts +++ b/terminus-terminal/src/components/searchPanel.component.ts @@ -23,18 +23,24 @@ export class SearchPanelComponent { onQueryChange (): void { this.notFound = false - this.findNext(true) + this.findPrevious(true) } findNext (incremental = false): void { + if (!this.query) { + return + } if (!this.frontend.findNext(this.query, { ...this.options, incremental: incremental || undefined })) { this.notFound = true this.toastr.error('Not found') } } - findPrevious (): void { - if (!this.frontend.findPrevious(this.query, this.options)) { + findPrevious (incremental = false): void { + if (!this.query) { + return + } + if (!this.frontend.findPrevious(this.query, { ...this.options, incremental: incremental || undefined })) { this.notFound = true this.toastr.error('Not found') }