style.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2016 The G3N Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package gui
  5. import (
  6. "github.com/g3n/engine/math32"
  7. "github.com/g3n/engine/text"
  8. )
  9. // Style contains the styles for all GUI elements
  10. type Style struct {
  11. Color ColorStyle
  12. Font *text.Font
  13. FontIcon *text.Font
  14. Label LabelStyle
  15. Button ButtonStyles
  16. CheckRadio CheckRadioStyles
  17. Edit EditStyles
  18. ScrollBar ScrollBarStyles
  19. Slider SliderStyles
  20. Splitter SplitterStyles
  21. Window WindowStyles
  22. ItemScroller ItemScrollerStyles
  23. Scroller ScrollerStyle
  24. List ListStyles
  25. DropDown DropDownStyles
  26. Folder FolderStyles
  27. Tree TreeStyles
  28. ControlFolder ControlFolderStyles
  29. Menu MenuStyles
  30. Table TableStyles
  31. ImageButton ImageButtonStyles
  32. TabBar TabBarStyles
  33. }
  34. // ColorStyle defines the main colors used.
  35. type ColorStyle struct {
  36. BgDark math32.Color4
  37. BgMed math32.Color4
  38. BgNormal math32.Color4
  39. BgOver math32.Color4
  40. Highlight math32.Color4
  41. Select math32.Color4
  42. Text math32.Color4
  43. TextDis math32.Color4
  44. }
  45. // States that a GUI element can be in
  46. const (
  47. StyleOver = iota + 1
  48. StyleFocus
  49. StyleDisabled
  50. StyleNormal
  51. StyleDef
  52. )