theme.go 1.7 KB

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