CheckButton.xml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CheckButton" inherits="Button" version="3.2">
  3. <brief_description>
  4. Checkable button. See also [CheckBox].
  5. </brief_description>
  6. <description>
  7. CheckButton is a toggle button displayed as a check field. It's similar to [CheckBox] in functionality, but it has a different apperance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an [b]immediate[/b] effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. </methods>
  13. <members>
  14. <member name="align" type="int" setter="set_text_align" getter="get_text_align" override="true" enum="Button.TextAlign" default="0" />
  15. <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" override="true" default="true" />
  16. </members>
  17. <constants>
  18. </constants>
  19. <theme_items>
  20. <theme_item name="check_vadjust" type="int" default="0">
  21. The vertical offset used when rendering the toggle icons (in pixels).
  22. </theme_item>
  23. <theme_item name="disabled" type="StyleBox">
  24. The [StyleBox] to display as a background when the [CheckButton] is disabled.
  25. </theme_item>
  26. <theme_item name="focus" type="StyleBox">
  27. The [StyleBox] to display as a background when the [CheckButton] is focused.
  28. </theme_item>
  29. <theme_item name="font" type="Font">
  30. The [Font] to use for the [CheckButton] text.
  31. </theme_item>
  32. <theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
  33. The [CheckButton] text's font color.
  34. </theme_item>
  35. <theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
  36. The [CheckButton] text's font color when it's disabled.
  37. </theme_item>
  38. <theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
  39. The [CheckButton] text's font color when it's hovered.
  40. </theme_item>
  41. <theme_item name="font_color_hover_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
  42. The [CheckButton] text's font color when it's hovered and pressed.
  43. </theme_item>
  44. <theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
  45. The [CheckButton] text's font color when it's pressed.
  46. </theme_item>
  47. <theme_item name="hover" type="StyleBox">
  48. The [StyleBox] to display as a background when the [CheckButton] is hovered.
  49. </theme_item>
  50. <theme_item name="hover_pressed" type="StyleBox">
  51. The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed.
  52. </theme_item>
  53. <theme_item name="hseparation" type="int" default="4">
  54. The separation between the toggle icon and the text (in pixels).
  55. </theme_item>
  56. <theme_item name="normal" type="StyleBox">
  57. The [StyleBox] to display as a background.
  58. </theme_item>
  59. <theme_item name="off" type="Texture">
  60. The icon to display when the [CheckButton] is unchecked.
  61. </theme_item>
  62. <theme_item name="off_disabled" type="Texture">
  63. The icon to display when the [CheckButton] is unchecked and disabled.
  64. </theme_item>
  65. <theme_item name="on" type="Texture">
  66. The icon to display when the [CheckButton] is checked.
  67. </theme_item>
  68. <theme_item name="on_disabled" type="Texture">
  69. The icon to display when the [CheckButton] is checked and disabled.
  70. </theme_item>
  71. <theme_item name="pressed" type="StyleBox">
  72. The [StyleBox] to display as a background when the [CheckButton] is pressed.
  73. </theme_item>
  74. </theme_items>
  75. </class>