Change default theme to Dracula

This commit is contained in:
rigormorrtiss 2021-07-30 22:13:59 +04:00
parent 8f384643f4
commit 7fe268b813
3 changed files with 34 additions and 17 deletions

View file

@ -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)
}

View file

@ -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 != "" {

View file

@ -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 {