dropdowns.go 693 B

1234567891011121314151617181920212223
  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) *tview.DropDown {
  8. guildsDropDown := tview.NewDropDown()
  9. guildsDropDown.
  10. SetLabel("Guild: ").
  11. SetSelectedFunc(onGuildsDropDownSelected).
  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 guildsDropDown
  19. }