lists.go 717 B

12345678910111213141516171819202122
  1. package ui
  2. import (
  3. "github.com/gdamore/tcell/v2"
  4. "github.com/rigormorrtiss/discordo/util"
  5. "github.com/rivo/tview"
  6. )
  7. func NewChannelsList(onChannelsListSelected func(i int, mainText string, secondaryText string, _ rune), theme *util.Theme) (channelsList *tview.List) {
  8. channelsList = tview.NewList().
  9. ShowSecondaryText(false).
  10. SetSelectedFunc(onChannelsListSelected)
  11. channelsList.
  12. SetMainTextColor(tcell.GetColor(theme.ListMainTextForeground)).
  13. SetSelectedTextColor(tcell.GetColor(theme.ListSelectedForeground)).
  14. SetSelectedBackgroundColor(tcell.GetColor(theme.ListBackground)).
  15. SetBackgroundColor(tcell.GetColor(theme.ListBackground)).
  16. SetBorder(true).
  17. SetBorderPadding(0, 0, 1, 1)
  18. return
  19. }