|
@@ -8,7 +8,6 @@ import (
|
|
|
// NewMessagesView creates and returns a new messages textview.
|
|
// NewMessagesView creates and returns a new messages textview.
|
|
|
func NewMessagesView(
|
|
func NewMessagesView(
|
|
|
app *tview.Application,
|
|
app *tview.Application,
|
|
|
- onMessagesTextViewInputCapture func(*tcell.EventKey) *tcell.EventKey,
|
|
|
|
|
) *tview.TextView {
|
|
) *tview.TextView {
|
|
|
v := tview.NewTextView()
|
|
v := tview.NewTextView()
|
|
|
v.
|
|
v.
|
|
@@ -19,7 +18,6 @@ func NewMessagesView(
|
|
|
SetChangedFunc(func() {
|
|
SetChangedFunc(func() {
|
|
|
app.Draw()
|
|
app.Draw()
|
|
|
}).
|
|
}).
|
|
|
- SetInputCapture(onMessagesTextViewInputCapture).
|
|
|
|
|
SetBorder(true).
|
|
SetBorder(true).
|
|
|
SetBorderPadding(0, 0, 1, 0).
|
|
SetBorderPadding(0, 0, 1, 0).
|
|
|
SetTitleAlign(tview.AlignLeft)
|
|
SetTitleAlign(tview.AlignLeft)
|
|
@@ -28,15 +26,12 @@ func NewMessagesView(
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// NewMessageInputField creates and returns a new message inputfield.
|
|
// NewMessageInputField creates and returns a new message inputfield.
|
|
|
-func NewMessageInputField(
|
|
|
|
|
- onMessageInputFieldInputCapture func(*tcell.EventKey) *tcell.EventKey,
|
|
|
|
|
-) *tview.InputField {
|
|
|
|
|
|
|
+func NewMessageInputField() *tview.InputField {
|
|
|
i := tview.NewInputField()
|
|
i := tview.NewInputField()
|
|
|
i.
|
|
i.
|
|
|
SetPlaceholder("Message...").
|
|
SetPlaceholder("Message...").
|
|
|
SetPlaceholderTextColor(tcell.ColorWhite).
|
|
SetPlaceholderTextColor(tcell.ColorWhite).
|
|
|
SetFieldBackgroundColor(tview.Styles.PrimitiveBackgroundColor).
|
|
SetFieldBackgroundColor(tview.Styles.PrimitiveBackgroundColor).
|
|
|
- SetInputCapture(onMessageInputFieldInputCapture).
|
|
|
|
|
SetBorder(true).
|
|
SetBorder(true).
|
|
|
SetBorderPadding(0, 0, 1, 0).
|
|
SetBorderPadding(0, 0, 1, 0).
|
|
|
SetTitleAlign(tview.AlignLeft)
|
|
SetTitleAlign(tview.AlignLeft)
|