theme.go 395 B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2018 visualfc. All rights reserved.
  2. package tk
  3. type NativeAttr struct {
  4. Key string
  5. Value string
  6. }
  7. type Theme interface {
  8. Name() string
  9. IsTtk() bool
  10. InitAttributes(typ WidgetType) []NativeAttr
  11. }
  12. func SetMainTheme(theme Theme) {
  13. mainTheme = theme
  14. }
  15. func MainTheme() Theme {
  16. return mainTheme
  17. }
  18. func HasTheme() bool {
  19. return mainTheme != nil
  20. }
  21. var (
  22. mainTheme Theme
  23. )