From 7fe268b81323f9062d5673b63700ba1abcbf7f58 Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Fri, 30 Jul 2021 22:13:59 +0400 Subject: [PATCH] Change default theme to Dracula --- discordo.go | 17 +++++++++++++++-- util/discord.go | 6 +++--- util/theme.go | 28 ++++++++++++++++------------ 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/discordo.go b/discordo.go index 1b960ec..741bed8 100644 --- a/discordo.go +++ b/discordo.go @@ -30,6 +30,19 @@ var ( ) func main() { + tview.Borders.HorizontalFocus = tview.Borders.Horizontal + tview.Borders.VerticalFocus = tview.Borders.Vertical + tview.Borders.TopLeftFocus = tview.Borders.TopLeft + tview.Borders.TopRightFocus = tview.Borders.TopRight + tview.Borders.BottomLeftFocus = tview.Borders.BottomLeft + tview.Borders.BottomRightFocus = tview.Borders.BottomRight + tview.Borders.Horizontal = ' ' + tview.Borders.Vertical = ' ' + tview.Borders.TopLeft = ' ' + tview.Borders.TopRight = ' ' + tview.Borders.BottomLeft = ' ' + tview.Borders.BottomRight = ' ' + theme = util.NewTheme() loginModal = ui.NewLoginModal(onLoginModalDone) guildsDropDown = ui.NewGuildsDropDown(onGuildsDropDownSelected, theme) @@ -167,7 +180,7 @@ func onGuildsDropDownSelected(text string, _ int) { switch channel.Type { case discordgo.ChannelTypeGuildCategory: - channelNode.SetColor(tcell.ColorDarkCyan) + channelNode.SetColor(tcell.GetColor(theme.TreeNodeForeground)) channelsTreeNode.AddChild(channelNode) default: if channel.ParentID == "" { @@ -192,7 +205,7 @@ func onChannelsTreeViewSelected(node *tview.TreeNode) { for i := range currentGuild.Channels { channel := currentGuild.Channels[i] if channel.ParentID == currentChannel.ID { - channelNode := tview.NewTreeNode(channel.Name). + channelNode := tview.NewTreeNode("[::d]#" + channel.Name + "[-:-:-]"). SetReference(channel) node.AddChild(channelNode) } diff --git a/util/discord.go b/util/discord.go index 43ecf90..0ca8d4d 100644 --- a/util/discord.go +++ b/util/discord.go @@ -14,18 +14,18 @@ func WriteMessage(messagesTextView *tview.TextView, session *discordgo.Session, var content strings.Builder if session.State.User.ID == message.Author.ID { - content.WriteString("[#26BBD9::b]") + content.WriteString("[#50fa7b::b]") content.WriteString(message.Author.Username) content.WriteString("[-:-:-] ") } else { - content.WriteString("[#E95678::b]") + content.WriteString("[#ff5555::b]") content.WriteString(message.Author.Username) content.WriteString("[-:-:-] ") } // If the author of the message is a bot account, add "BOT" beside the username of the author. if message.Author.Bot { - content.WriteString("[#29D398]BOT[-:-:-] ") + content.WriteString("[#bd93f9]BOT[-:-:-] ") } if message.Content != "" { diff --git a/util/theme.go b/util/theme.go index ffa4c30..165e68c 100644 --- a/util/theme.go +++ b/util/theme.go @@ -6,26 +6,30 @@ import ( ) type Theme struct { - DropDownBackground string `json:"dropdown.background"` + DropDownBackground string `json:"dropdown.background"` + TreeViewBackground string `json:"treeview.background"` + TextViewBackground string `json:"textview.background"` + InputFieldBackground string `json:"inputField.background"` + DropDownForeground string `json:"dropdown.foreground"` - InputFieldBackground string `json:"inputField.background"` + TextViewForeground string `json:"textview.foreground"` + TreeNodeForeground string `json:"treenode.foreground"` InputFieldForeground string `json:"inputField.foreground"` InputFieldPlaceholderForeground string `json:"inputField.placeholderTextForeground"` - TreeViewBackground string `json:"treeview.background"` - TextViewBackground string `json:"textview.background"` - TextViewForeground string `json:"textview.foreground"` } func NewTheme() *Theme { var theme Theme - theme.TextViewBackground = "#2E3440" - theme.TextViewForeground = "#D8DEE9" - theme.TreeViewBackground = "#2E3440" - theme.InputFieldBackground = "#3B4252" - theme.InputFieldForeground = "#D8DEE9" - theme.InputFieldPlaceholderForeground = "#D8DEE9" theme.DropDownBackground = "#3B4252" - theme.DropDownForeground = "#D8DEE9" + theme.TreeViewBackground = "#282a36" + theme.TextViewBackground = "#282a36" + theme.InputFieldBackground = "#3B4252" + + theme.DropDownForeground = "#f8f8f2" + theme.TextViewForeground = "#f8f8f2" + theme.TreeNodeForeground = "#8be9fd" + theme.InputFieldForeground = "#f8f8f2" + theme.InputFieldPlaceholderForeground = "#6272a4" userHomeDir, err := os.UserHomeDir() if err != nil {