Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Finish navigation help
Browse files Browse the repository at this point in the history
bow committed Nov 23, 2023

Verified

This commit was signed with the committer’s verified signature.
bow Wibowo Arindrarto
1 parent 4de3f80 commit 46a1e16
Showing 1 changed file with 40 additions and 9 deletions.
49 changes: 40 additions & 9 deletions internal/tui/tui.go
Original file line number Diff line number Diff line change
@@ -96,23 +96,54 @@ func Show(db internal.FeedStore) error {
mainPage.
AddItem(wideFlex, 0, 0, 1, 1, 0, wideViewMinWidth, false)

helpPage := tview.NewFrame(nil).
SetBorder(true).
help1 := tview.NewTextView().
SetDynamicColors(true).
SetText(`[aqua]Feeds pane[-]
[yellow]j[-]: Next item
[yellow]k[-]: Previous item
[yellow]p[-]: Pull current feed
[yellow]P[-]: Pull all feeds
[yellow]R[-]: Mark all entries in current feed read
[yellow]s[-]: Star / unstar feed
[yellow]e[-]: Edit feed
[yellow]d[-]: Delete feed
[aqua]Entries pane[-]
[yellow]j[-]: Next entry
[yellow]k[-]: Previous entry
[yellow]r[-]: Mark current entry read
[yellow]u[-]: Mark current entry unread
[yellow]b[-]: Add / remove entry from bookmarks
[aqua]Content pane[-]
[yellow]j[-]: Scroll down
[yellow]k[-]: Scroll up
[yellow]g[-]: Go to top
[yellow]G[-]: Go to bottom
[aqua]Global[-]
[yellow]a[-] : Add feed
[yellow]Tab[-]: Switch to next pane
[yellow]X[-] : Export feeds to OPML
[yellow]I[-] : Import feeds from OPML
[yellow]h[-] : Toggle this help
[yellow]q[-] : Quit reader`)

helpPage := tview.NewFrame(help1).
SetBorders(1, 1, 0, 0, 2, 2)

helpPage.SetBorder(true).
SetBorderColor(helpBorderLineForeground).
SetTitle(" [::b]Help[::-] ").
SetTitle(" Keys ").
SetTitleColor(helpTitleForeground)

helpPage.
SetFocusFunc(func() { helpPage.SetTitle(" [::b]Help[::-] ") }).
SetBlurFunc(func() { helpPage.SetTitle(" Help ") })

root.
AddAndSwitchToPage("main", mainPage, true).
AddPage(
"help",
tview.NewGrid().
SetColumns(0, 64, 0).
SetRows(0, 22, 0).
SetColumns(0, 50, 0).
SetRows(0, 34, 0).
AddItem(helpPage, 1, 1, 1, 1, 0, 0, true),
true,
false,

0 comments on commit 46a1e16

Please sign in to comment.