theme.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package config
  2. import "github.com/rivo/tview"
  3. type (
  4. Theme struct {
  5. Border bool `toml:"border"`
  6. BorderColor string `toml:"border_color"`
  7. BorderPadding [4]int `toml:"border_padding"`
  8. TitleColor string `toml:"title_color"`
  9. BackgroundColor string `toml:"background_color"`
  10. GuildsTree GuildsTreeTheme `toml:"guilds_tree"`
  11. MessagesText MessagesTextTheme `toml:"messages_text"`
  12. }
  13. GuildsTreeTheme struct {
  14. AutoExpandFolders bool `toml:"auto_expand_folders"`
  15. ChannelColor string `toml:"channel_color"`
  16. Graphics bool `toml:"graphics"`
  17. GuildColor string `toml:"guild_color"`
  18. PrivateChannelColor string `toml:"private_channel_color"`
  19. }
  20. MessagesTextTheme struct {
  21. ReplyIndicator string `toml:"reply_indicator"`
  22. AuthorColor string `toml:"author_color"`
  23. ContentColor string `toml:"content_color"`
  24. EmojiColor string `toml:"emoji_color"`
  25. LinkColor string `toml:"link_color"`
  26. AttachmentColor string `toml:"attachment_color"`
  27. }
  28. )
  29. func defaultTheme() Theme {
  30. return Theme{
  31. Border: true,
  32. BorderColor: "default",
  33. BorderPadding: [...]int{0, 0, 1, 1},
  34. BackgroundColor: "default",
  35. TitleColor: "default",
  36. GuildsTree: GuildsTreeTheme{
  37. AutoExpandFolders: true,
  38. ChannelColor: tview.Styles.PrimaryTextColor.String(),
  39. Graphics: true,
  40. GuildColor: tview.Styles.PrimaryTextColor.String(),
  41. PrivateChannelColor: tview.Styles.PrimaryTextColor.String(),
  42. },
  43. MessagesText: MessagesTextTheme{
  44. ReplyIndicator: string(tview.BoxDrawingsLightArcDownAndRight) + " ",
  45. AuthorColor: "aqua",
  46. ContentColor: tview.Styles.PrimaryTextColor.String(),
  47. EmojiColor: "green",
  48. LinkColor: "blue",
  49. AttachmentColor: "yellow",
  50. },
  51. }
  52. }