dropdowns.go 693 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 NewGuildsDropDown(onGuildsDropDownSelected func(text string, index int), theme *util.Theme) (guildsDropDown *tview.DropDown) {
  8. guildsDropDown = tview.NewDropDown().
  9. SetLabel("Guild: ").
  10. SetSelectedFunc(onGuildsDropDownSelected)
  11. guildsDropDown.
  12. SetLabelColor(tcell.GetColor(theme.DropDownForeground)).
  13. SetFieldBackgroundColor(tcell.GetColor(theme.DropDownBackground)).
  14. SetFieldTextColor(tcell.GetColor(theme.DropDownForeground)).
  15. SetBackgroundColor(tcell.GetColor(theme.DropDownBackground)).
  16. SetBorder(true).
  17. SetBorderPadding(0, 0, 1, 1)
  18. return
  19. }