theme.go 1.9 KB

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