diff --git a/cmd/guilds_tree.go b/cmd/guilds_tree.go index bc7a37a..f95d6cb 100644 --- a/cmd/guilds_tree.go +++ b/cmd/guilds_tree.go @@ -73,6 +73,7 @@ func (gt *GuildsTree) createFolderNode(folder gateway.GuildFolder) { func (gt *GuildsTree) createGuildNode(n *tview.TreeNode, g discord.Guild) { guildNode := tview.NewTreeNode(g.Name) guildNode.SetReference(g.ID) + guildNode.SetColor(tcell.GetColor(cfg.Theme.GuildsTree.GuildColor)) n.AddChild(guildNode) } @@ -124,6 +125,7 @@ func (gt *GuildsTree) createChannelNode(n *tview.TreeNode, c discord.Channel) *t channelNode := tview.NewTreeNode(gt.channelToString(c)) channelNode.SetReference(c.ID) + channelNode.SetColor(tcell.GetColor(cfg.Theme.GuildsTree.ChannelColor)) n.AddChild(channelNode) return channelNode } diff --git a/cmd/messages_text.go b/cmd/messages_text.go index f4340c9..41fee40 100644 --- a/cmd/messages_text.go +++ b/cmd/messages_text.go @@ -39,6 +39,7 @@ func newMessagesText() *MessagesText { app.Draw() }) + mt.SetTextColor(tcell.GetColor(cfg.Theme.MessagesText.ContentColor)) mt.SetBackgroundColor(tcell.GetColor(cfg.Theme.BackgroundColor)) mt.SetTitle("Messages") diff --git a/cmd/state.go b/cmd/state.go index 40f4b66..741ccea 100644 --- a/cmd/state.go +++ b/cmd/state.go @@ -12,6 +12,7 @@ import ( "github.com/diamondburned/arikawa/v3/gateway" "github.com/diamondburned/arikawa/v3/utils/httputil/httpdriver" "github.com/diamondburned/ningen/v3" + "github.com/gdamore/tcell/v2" "github.com/rivo/tview" ) @@ -54,6 +55,7 @@ func (s *State) onRequest(r httpdriver.Request) error { func (s *State) onReady(r *gateway.ReadyEvent) { root := mainFlex.guildsTree.GetRoot() dmNode := tview.NewTreeNode("Direct Messages") + dmNode.SetColor(tcell.GetColor(cfg.Theme.GuildsTree.PrivateChannelColor)) root.AddChild(dmNode) // Track guilds that have a parent (folder) to add orphan channels later diff --git a/internal/config/theme.go b/internal/config/theme.go index cea85a8..87ad987 100644 --- a/internal/config/theme.go +++ b/internal/config/theme.go @@ -16,12 +16,16 @@ type ( } GuildsTreeTheme struct { - AutoExpandFolders bool `toml:"auto_expand_folders"` - Graphics bool `toml:"graphics"` + AutoExpandFolders bool `toml:"auto_expand_folders"` + ChannelColor string `toml:"channel_color"` + Graphics bool `toml:"graphics"` + GuildColor string `toml:"guild_color"` + PrivateChannelColor string `toml:"private_channel_color"` } MessagesTextTheme struct { AuthorColor string `toml:"author_color"` + ContentColor string `toml:"content_color"` EmoteColor string `toml:"emote_color"` ReplyIndicator string `toml:"reply_indicator"` } @@ -37,11 +41,15 @@ func defaultTheme() Theme { TitleColor: "default", GuildsTree: GuildsTreeTheme{ - AutoExpandFolders: true, - Graphics: true, + AutoExpandFolders: true, + ChannelColor: tview.Styles.PrimaryTextColor.String(), + Graphics: true, + GuildColor: tview.Styles.PrimaryTextColor.String(), + PrivateChannelColor: tview.Styles.PrimaryTextColor.String(), }, MessagesText: MessagesTextTheme{ AuthorColor: "aqua", + ContentColor: tview.Styles.PrimaryTextColor.String(), EmoteColor: "green", ReplyIndicator: string(tview.BoxDrawingsLightArcDownAndRight) + " ", },