lists.go 568 B

123456789101112131415161718192021
  1. package ui
  2. import (
  3. "github.com/gdamore/tcell/v2"
  4. "github.com/rivo/tview"
  5. )
  6. func NewChannelsList(onChannelsListSelected func(i int, mainText string, secondaryText string, _ rune)) (channelsList *tview.List) {
  7. channelsList = tview.NewList().
  8. ShowSecondaryText(false).
  9. SetMainTextColor(tcell.ColorDarkGray).
  10. SetSelectedTextColor(tcell.ColorWhite).
  11. SetSelectedBackgroundColor(tview.Styles.PrimitiveBackgroundColor).
  12. SetSelectedFunc(onChannelsListSelected)
  13. channelsList.
  14. SetBorder(true).
  15. SetBorderPadding(0, 0, 1, 1).
  16. SetTitle("Channels")
  17. return
  18. }