dropdowns.go 571 B

123456789101112131415161718192021
  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. SetFieldBackgroundColor(tcell.GetColor(theme.DropDownBackground)).
  13. SetBackgroundColor(tcell.GetColor(theme.DropDownBackground)).
  14. SetBorder(true).
  15. SetBorderPadding(0, 0, 1, 1)
  16. return guildsDropDown
  17. }