lists.go 527 B

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