Skip to content

Commit

Permalink
Bug Fix: Fixed search field width
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Jan 13, 2024
1 parent 5da3fdf commit ceb8005
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tui/search-form.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
)

func (pv *pcView) showSearch() {
const fieldWidth = 50
f := tview.NewForm()
f.SetCancelFunc(func() {
pv.pages.RemovePage(PageDialog)
Expand All @@ -16,7 +17,7 @@ func (pv *pcView) showSearch() {
f.SetFieldTextColor(tcell.ColorBlack)
f.SetButtonsAlign(tview.AlignCenter)
f.SetTitle("Search Log")
f.AddInputField("Search For", pv.logsText.getSearchTerm(), 50, nil, nil)
f.AddInputField("Search For", pv.logsText.getSearchTerm(), fieldWidth, nil, nil)
f.AddCheckbox("Case Sensitive", false, nil)
f.AddCheckbox("Regex", false, nil)
searchFunc := func() {
Expand Down Expand Up @@ -49,6 +50,6 @@ func (pv *pcView) showSearch() {
})
f.SetFocus(0)
// Display and focus the dialog
pv.pages.AddPage(PageDialog, createDialogPage(f, 60, 11), true, true)
pv.pages.AddPage(PageDialog, createDialogPage(f, fieldWidth+20, 11), true, true)
pv.appView.SetFocus(f)
}

0 comments on commit ceb8005

Please sign in to comment.