|
|
@@ -9,6 +9,7 @@ import (
|
|
|
"github.com/atotto/clipboard"
|
|
|
"github.com/ayn2op/discordo/internal/config"
|
|
|
"github.com/ayn2op/discordo/internal/consts"
|
|
|
+ "github.com/ayn2op/discordo/internal/ui"
|
|
|
"github.com/diamondburned/arikawa/v3/api"
|
|
|
"github.com/diamondburned/arikawa/v3/discord"
|
|
|
"github.com/diamondburned/arikawa/v3/utils/json/option"
|
|
|
@@ -32,31 +33,17 @@ func newMessageInput(app *tview.Application, cfg *config.Config) *MessageInput {
|
|
|
app: app,
|
|
|
}
|
|
|
|
|
|
- t := cfg.Theme
|
|
|
+ mi.Box = ui.NewConfiguredBox(mi.Box, &cfg.Theme)
|
|
|
+
|
|
|
mi.
|
|
|
- SetTextStyle(tcell.StyleDefault.Background(tcell.GetColor(t.BackgroundColor))).
|
|
|
+ SetTextStyle(tcell.StyleDefault.Background(tcell.GetColor(cfg.Theme.BackgroundColor))).
|
|
|
SetClipboard(func(s string) {
|
|
|
_ = clipboard.WriteAll(s)
|
|
|
}, func() string {
|
|
|
text, _ := clipboard.ReadAll()
|
|
|
return text
|
|
|
- })
|
|
|
-
|
|
|
- b := t.Border
|
|
|
- p := b.Padding
|
|
|
- mi.
|
|
|
- SetInputCapture(mi.onInputCapture).
|
|
|
- SetTitleAlign(tview.AlignLeft).
|
|
|
- SetBorder(b.Enabled).
|
|
|
- SetBorderPadding(p[0], p[1], p[2], p[3]).
|
|
|
- SetFocusFunc(func() {
|
|
|
- mi.SetBorderColor(tcell.GetColor(b.ActiveColor))
|
|
|
- mi.SetTitleColor(tcell.GetColor(t.ActiveTitleColor))
|
|
|
}).
|
|
|
- SetBlurFunc(func() {
|
|
|
- mi.SetBorderColor(tcell.GetColor(b.Color))
|
|
|
- mi.SetTitleColor(tcell.GetColor(t.TitleColor))
|
|
|
- })
|
|
|
+ SetInputCapture(mi.onInputCapture)
|
|
|
|
|
|
return mi
|
|
|
}
|