diff --git a/internal/char/symbols_unix.go b/internal/char/symbols_unix.go new file mode 100644 index 0000000..30e1ef5 --- /dev/null +++ b/internal/char/symbols_unix.go @@ -0,0 +1,8 @@ +//go:build !windows + +package char + +const ( + SymSearch = "🔎" + SymKey = "🔑" +) diff --git a/internal/char/symbols_windows.go b/internal/char/symbols_windows.go new file mode 100644 index 0000000..0d258b4 --- /dev/null +++ b/internal/char/symbols_windows.go @@ -0,0 +1,8 @@ +//go:build windows + +package char + +const ( + SymSearch = "ƒ" + SymKey = "≡" +) diff --git a/internal/loggo/filter_view.go b/internal/loggo/filter_view.go index e1f38ed..fff9dae 100644 --- a/internal/loggo/filter_view.go +++ b/internal/loggo/filter_view.go @@ -24,6 +24,7 @@ package loggo import ( "fmt" + "github.com/aurc/loggo/internal/char" "strings" "github.com/aurc/loggo/internal/filter" @@ -143,7 +144,7 @@ func (t *FilterView) makeLayouts() { t.Flex.Clear() filterRow := tview.NewFlex().SetDirection(tview.FlexColumn) filterField := tview.NewFlex().SetDirection(tview.FlexColumn). - AddItem(tview.NewTextView().SetText("🔎").SetTextAlign(tview.AlignCenter), 4, 1, true). + AddItem(tview.NewTextView().SetText(char.SymSearch).SetTextAlign(tview.AlignCenter), 4, 1, true). AddItem(t.expressionField, 0, 1, true) filterField.SetBorder(true) filterRow. @@ -161,7 +162,7 @@ func (t *FilterView) makeLayouts() { okButton := tview.NewButton("OK").SetSelectedFunc(t.addKey) okButton.SetBackgroundColor(tcell.ColorGreen) actionBar := tview.NewFlex().SetDirection(tview.FlexColumn) - actionBar.AddItem(tview.NewTextView().SetText(" 🔑 Finder:"), 12, 0, false) + actionBar.AddItem(tview.NewTextView().SetText(fmt.Sprintf(" %s Finder:", char.SymKey)), 12, 0, false) actionBar.AddItem(t.keyFinderField, 0, 1, false). AddItem(tview.NewBox(), 1, 1, false). AddItem(okButton, 4, 1, false). diff --git a/internal/loggo/log_view.go b/internal/loggo/log_view.go index e91c3d7..7073812 100644 --- a/internal/loggo/log_view.go +++ b/internal/loggo/log_view.go @@ -100,6 +100,7 @@ func NewLogReader(app *LoggoApp, reader reader.Reader) *LogView { go func() { time.Sleep(10 * time.Millisecond) lv.isFollowing = true + lv.app.SetFocus(lv.table) }() return lv } diff --git a/internal/loggo/log_view_nav_menu.go b/internal/loggo/log_view_nav_menu.go index e572561..4c16872 100644 --- a/internal/loggo/log_view_nav_menu.go +++ b/internal/loggo/log_view_nav_menu.go @@ -24,6 +24,7 @@ package loggo import ( "fmt" + "runtime" "github.com/aurc/loggo/internal/color" "github.com/gdamore/tcell/v2" @@ -63,7 +64,7 @@ func (l *LogView) populateMenu() { NewHorizontalSeparator(sepStyle, LineHThick, "Navigation", sepForeground), 1, 2, false). AddItem(tview.NewTextView(). SetDynamicColors(true). - SetText("[yellow::b] ↲[-::-] View Entry"), 1, 3, false). + SetText("[yellow::b] Enter[-::-] View Entry"), 1, 3, false). AddItem(tview.NewTextView(). SetDynamicColors(true). SetText("[yellow::b] ↓ ↑ ← →[-::-] Navigate"), 1, 3, false). @@ -94,20 +95,24 @@ func (l *LogView) populateMenu() { SetText(`[yellow::b] ^f [-::u]["1"]Pg Down[""]`), func() { l.isFollowing = false l.table.InputHandler()(tcell.NewEventKey(tcell.KeyPgDn, '0', 0), func(p tview.Primitive) {}) - }), 1, 2, false). - ////////////////////////////////////////////////////////////////// - // Selection Menu - ////////////////////////////////////////////////////////////////// - AddItem(NewHorizontalSeparator(sepStyle, LineHThick, "Selection", sepForeground), 1, 2, false). - AddItem(tview.NewTextView(). - SetDynamicColors(true). - SetText("[yellow::b] ⌥ 🖱 [-::-] Horizontal"), 1, 3, false). - AddItem(tview.NewTextView(). - SetDynamicColors(true). - SetText("[yellow::b] ⌥ ⌘ 🖱 [-::-] Vertical"), 1, 3, false). - ////////////////////////////////////////////////////////////////// - // Application Menu - ////////////////////////////////////////////////////////////////// + }), 1, 2, false) + ////////////////////////////////////////////////////////////////// + // Selection Menu + ////////////////////////////////////////////////////////////////// + if runtime.GOOS != "windows" { + l.navMenu. + AddItem(NewHorizontalSeparator(sepStyle, LineHThick, "Selection", sepForeground), 1, 2, false). + AddItem(tview.NewTextView(). + SetDynamicColors(true). + SetText("[yellow::b] ⌥ 🖱 [-::-] Horizontal"), 1, 3, false). + AddItem(tview.NewTextView(). + SetDynamicColors(true). + SetText("[yellow::b] ⌥ ⌘ 🖱 [-::-] Vertical"), 1, 3, false) + } + ////////////////////////////////////////////////////////////////// + // Application Menu + ////////////////////////////////////////////////////////////////// + l.navMenu. AddItem(NewHorizontalSeparator(sepStyle, LineHThick, "Application", sepForeground), 1, 2, false). AddItem(l.textViewMenuControl(tview.NewTextView(). SetDynamicColors(true).SetRegions(true). diff --git a/internal/loggo/log_view_table_data.go b/internal/loggo/log_view_table_data.go index 9d89ecc..bcbb593 100644 --- a/internal/loggo/log_view_table_data.go +++ b/internal/loggo/log_view_table_data.go @@ -45,22 +45,22 @@ func (d *LogData) GetCell(row, column int) *tview.TableCell { } if column == 0 { if row == 0 { - tc := tview.NewTableCell("[yellow] ☀[white] / [blue]☂ "). + tc := tview.NewTableCell("[yellow] Line # "). SetAlign(tview.AlignCenter). SetBackgroundColor(tcell.ColorBlack). SetSelectable(false) return tc } else { if _, ok := d.logView.finSlice[row-1][config.ParseErr]; ok { - tc := tview.NewTableCell(" ︎ ☂ "). - SetTextColor(tcell.ColorBlue). - SetAlign(tview.AlignCenter). + tc := tview.NewTableCell(fmt.Sprintf("%d ", row)). + SetTextColor(tcell.ColorRed). + SetAlign(tview.AlignRight). SetBackgroundColor(tcell.ColorBlack) return tc } else { - tc := tview.NewTableCell(" ︎☀ ︎ "). + tc := tview.NewTableCell(fmt.Sprintf("%d ", row)). SetTextColor(tcell.ColorYellow). - SetAlign(tview.AlignCenter). + SetAlign(tview.AlignRight). SetBackgroundColor(tcell.ColorBlack) return tc }