discordo/ui/inputfields.go
rigormorrtiss c9dd1fcf02 main: integrate user guilds in TreeView (#24)
* main: integrate user guilds in TreeView

* assets: update README preview
2021-08-11 22:59:31 +04:00

23 lines
758 B
Go

package ui
import (
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/session"
"github.com/gdamore/tcell/v2"
"github.com/rigormorrtiss/discordo/util"
"github.com/rivo/tview"
)
func NewMessageInputField(onMessageInputFieldInputCapture func(event *tcell.EventKey) *tcell.EventKey, s *session.Session, c discord.Channel, theme *util.Theme) *tview.InputField {
i := tview.NewInputField()
i.
SetPlaceholder("Message...").
SetPlaceholderTextColor(tcell.ColorWhite).
SetFieldBackgroundColor(tcell.GetColor(theme.InputFieldBackground)).
SetBackgroundColor(tcell.GetColor(theme.InputFieldBackground)).
SetBorder(true).
SetBorderPadding(0, 0, 1, 1).
SetInputCapture(onMessageInputFieldInputCapture)
return i
}