theme.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. AuthorColor string `toml:"author_color"`
  22. ContentColor string `toml:"content_color"`
  23. EmojiColor string `toml:"emoji_color"`
  24. ReplyIndicator string `toml:"reply_indicator"`
  25. }
  26. )
  27. func defaultTheme() Theme {
  28. return Theme{
  29. Border: true,
  30. BorderColor: "default",
  31. BorderPadding: [...]int{0, 0, 1, 1},
  32. BackgroundColor: "default",
  33. TitleColor: "default",
  34. GuildsTree: GuildsTreeTheme{
  35. AutoExpandFolders: true,
  36. ChannelColor: tview.Styles.PrimaryTextColor.String(),
  37. Graphics: true,
  38. GuildColor: tview.Styles.PrimaryTextColor.String(),
  39. PrivateChannelColor: tview.Styles.PrimaryTextColor.String(),
  40. },
  41. MessagesText: MessagesTextTheme{
  42. AuthorColor: "aqua",
  43. ContentColor: tview.Styles.PrimaryTextColor.String(),
  44. EmojiColor: "green",
  45. ReplyIndicator: string(tview.BoxDrawingsLightArcDownAndRight) + " ",
  46. },
  47. }
  48. }