Commit cd690d5f authored by Trevor Slocum's avatar Trevor Slocum

Highlight library entry fully

parent 7ea726e4
Pipeline #139816200 passed with stages
in 2 minutes and 21 seconds
......@@ -14,7 +14,7 @@ require (
github.com/mewkiz/pkg v0.0.0-20200411195739-f6b5e26764c3 // indirect
github.com/pkg/errors v0.9.1 // indirect
gitlab.com/tslocum/cbind v0.1.1
gitlab.com/tslocum/cview v1.4.5-0.20200424220521-e97629839eba
gitlab.com/tslocum/cview v1.4.5-0.20200425133514-5bfb860744af
golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5 // indirect
golang.org/x/image v0.0.0-20200119044424-58c23975cae1 // indirect
golang.org/x/mobile v0.0.0-20200329125638-4c31acba0007 // indirect
......
......@@ -57,8 +57,8 @@ github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY=
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
gitlab.com/tslocum/cbind v0.1.1 h1:JXXtxMWHgWLvoF+QkrvcNvOQ59juy7OE1RhT7hZfdt0=
gitlab.com/tslocum/cbind v0.1.1/go.mod h1:rX7vkl0pUSg/yy427MmD1FZAf99S7WwpUlxF/qTpPqk=
gitlab.com/tslocum/cview v1.4.5-0.20200424220521-e97629839eba h1:DYq4lsxeUfkR6VYGwzWcRNJWLCgjpklNZt4HfESnyLA=
gitlab.com/tslocum/cview v1.4.5-0.20200424220521-e97629839eba/go.mod h1:85Ec3ByMemrI3tUK4Rpd8jcF3J7maOFHGwzlNnCrPVI=
gitlab.com/tslocum/cview v1.4.5-0.20200425133514-5bfb860744af h1:KFu6xaqWD4qp3rmtMD5e312r1dhgbZSxvdFoRGrO8zI=
gitlab.com/tslocum/cview v1.4.5-0.20200425133514-5bfb860744af/go.mod h1:85Ec3ByMemrI3tUK4Rpd8jcF3J7maOFHGwzlNnCrPVI=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
......
......@@ -73,8 +73,16 @@ func initTUI() error {
grid := cview.NewGrid().SetRows(-2, -1, 1, 1).SetColumns(-1)
mainList = cview.NewList().ShowSecondaryText(false)
queueList = cview.NewList().ShowSecondaryText(false)
mainList = cview.NewList().
ShowSecondaryText(false).
SetScrollBarVisibility(cview.ScrollBarAlways).
SetHighlightFullLine(true).
SetSelectedTextColor(tcell.ColorBlack)
queueList = cview.NewList().
ShowSecondaryText(false).
SetScrollBarVisibility(cview.ScrollBarAlways).
SetHighlightFullLine(true).
SetSelectedTextColor(tcell.ColorBlack)
topstatusbuf = cview.NewTextView().SetWrap(false).SetWordWrap(false)
bottomstatusbuf = cview.NewTextView().SetWrap(false).SetWordWrap(false)
......@@ -88,7 +96,9 @@ func initTUI() error {
grid.AddItem(topstatusbuf, 2, 0, 1, 1, 0, 0, false)
grid.AddItem(bottomstatusbuf, 3, 0, 1, 1, 0, 0, false)
app.SetRoot(grid, true).SetFocus(mainList)
app.SetRoot(grid, true)
focusUpdated()
return nil
}
......
......@@ -4,6 +4,7 @@ import (
"path"
"time"
"github.com/gdamore/tcell"
"gitlab.com/tslocum/cview"
)
......@@ -237,10 +238,20 @@ func listToggleHidden() {
func toggleFocusedList() {
queueFocused = !queueFocused
focusUpdated()
}
func focusUpdated() {
if queueFocused {
app.SetFocus(queueList)
mainList.SetSelectedBackgroundColor(tcell.ColorDimGray)
queueList.SetSelectedBackgroundColor(tcell.ColorWhite)
} else {
app.SetFocus(mainList)
mainList.SetSelectedBackgroundColor(tcell.ColorWhite)
queueList.SetSelectedBackgroundColor(tcell.ColorDimGray)
}
go app.QueueUpdateDraw(updateLists)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment