fix: set {background,title}_color globally

This commit is contained in:
ayn2op 2025-03-29 19:18:13 -04:00
parent 0930a884eb
commit 3e7d720fd1
4 changed files with 4 additions and 6 deletions

View file

@ -39,9 +39,7 @@ func newGuildsTree(app *tview.Application, cfg *config.Config) *GuildsTree {
p := b.Padding
gt.
SetInputCapture(gt.onInputCapture).
SetBackgroundColor(tcell.GetColor(cfg.Theme.BackgroundColor)).
SetTitle("Guilds").
SetTitleColor(tcell.GetColor(cfg.Theme.TitleColor)).
SetTitleAlign(tview.AlignLeft).
SetBorder(b.Enabled).
SetBorderPadding(p[0], p[1], p[2], p[3]).

View file

@ -46,8 +46,6 @@ func newMessageInput(app *tview.Application, cfg *config.Config) *MessageInput {
p := b.Padding
mi.
SetInputCapture(mi.onInputCapture).
SetBackgroundColor(tcell.GetColor(t.BackgroundColor)).
SetTitleColor(tcell.GetColor(t.TitleColor)).
SetTitleAlign(tview.AlignLeft).
SetBorder(b.Enabled).
SetBorderPadding(p[0], p[1], p[2], p[3]).

View file

@ -54,9 +54,7 @@ func newMessagesText(app *tview.Application, cfg *config.Config) *MessagesText {
p := b.Padding
mt.
SetInputCapture(mt.onInputCapture).
SetBackgroundColor(tcell.GetColor(t.BackgroundColor)).
SetTitle("Messages").
SetTitleColor(tcell.GetColor(t.TitleColor)).
SetTitleAlign(tview.AlignLeft).
SetBorder(b.Enabled).
SetBorderPadding(p[0], p[1], p[2], p[3]).

View file

@ -6,6 +6,7 @@ import (
"github.com/ayn2op/discordo/internal/config"
"github.com/ayn2op/discordo/internal/consts"
"github.com/ayn2op/discordo/internal/logger"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
"github.com/spf13/cobra"
"github.com/zalando/go-keyring"
@ -37,6 +38,9 @@ var (
return err
}
tview.Styles.PrimitiveBackgroundColor = tcell.GetColor(cfg.Theme.BackgroundColor)
tview.Styles.TitleColor = tcell.GetColor(cfg.Theme.TitleColor)
tview.Borders.Horizontal = cfg.Theme.Border.Preset.Horizontal
tview.Borders.Vertical = cfg.Theme.Border.Preset.Vertical
tview.Borders.TopLeft = cfg.Theme.Border.Preset.TopLeft