* feat(ui): add NewGuildsList() * fix(ui): remove redundant \n from guilds list * feat(ui): add guilds List to main Flex * refactor(ui): rename TreeView to channels TreeView * feat: separate guilds from TreeView * ui/flex: increase proportionate size of TreeView * main: sort guild channels according to channel positions * docs: update README preview * main: add keybinding for guilds List
19 lines
408 B
Go
19 lines
408 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/rigormorrtiss/discordo/util"
|
|
"github.com/rivo/tview"
|
|
)
|
|
|
|
func NewGuildsList(onGuildsListSelected func(int, string, string, rune), t *util.Theme) (l *tview.List) {
|
|
l = tview.NewList()
|
|
l.
|
|
SetSelectedFunc(onGuildsListSelected).
|
|
ShowSecondaryText(false).
|
|
SetBorder(true).
|
|
SetBorderPadding(0, 0, 1, 0).
|
|
SetTitle("Guilds").
|
|
SetTitleAlign(tview.AlignLeft)
|
|
|
|
return
|
|
}
|