dropdowns.go 521 B

1234567891011121314151617181920
  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(string, int), theme *util.Theme) (d *tview.DropDown) {
  8. d = tview.NewDropDown()
  9. d.
  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
  17. }