CheckButton.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CheckButton" inherits="Button" version="4.0">
  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 appearance. 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. See also [BaseButton] which contains common properties and methods associated with this node.
  9. </description>
  10. <tutorials>
  11. </tutorials>
  12. <members>
  13. <member name="align" type="int" setter="set_text_align" getter="get_text_align" override="true" enum="Button.TextAlign" default="0" />
  14. <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" override="true" default="true" />
  15. </members>
  16. <theme_items>
  17. <theme_item name="check_vadjust" data_type="constant" type="int" default="0">
  18. The vertical offset used when rendering the toggle icons (in pixels).
  19. </theme_item>
  20. <theme_item name="disabled" data_type="style" type="StyleBox">
  21. The [StyleBox] to display as a background when the [CheckButton] is disabled.
  22. </theme_item>
  23. <theme_item name="focus" data_type="style" type="StyleBox">
  24. The [StyleBox] to display as a background when the [CheckButton] is focused.
  25. </theme_item>
  26. <theme_item name="font" data_type="font" type="Font">
  27. The [Font] to use for the [CheckButton] text.
  28. </theme_item>
  29. <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)">
  30. The [CheckButton] text's font color.
  31. </theme_item>
  32. <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)">
  33. The [CheckButton] text's font color when it's disabled.
  34. </theme_item>
  35. <theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)">
  36. The [CheckButton] text's font color when it's focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
  37. </theme_item>
  38. <theme_item name="font_hover_color" data_type="color" 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_hover_pressed_color" data_type="color" 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_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  45. The tint of text outline of the [CheckButton].
  46. </theme_item>
  47. <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  48. The [CheckButton] text's font color when it's pressed.
  49. </theme_item>
  50. <theme_item name="font_size" data_type="font_size" type="int">
  51. Font size of the [CheckButton]'s text.
  52. </theme_item>
  53. <theme_item name="hover" data_type="style" type="StyleBox">
  54. The [StyleBox] to display as a background when the [CheckButton] is hovered.
  55. </theme_item>
  56. <theme_item name="hover_pressed" data_type="style" type="StyleBox">
  57. The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed.
  58. </theme_item>
  59. <theme_item name="hseparation" data_type="constant" type="int" default="4">
  60. The separation between the toggle icon and the text (in pixels).
  61. </theme_item>
  62. <theme_item name="normal" data_type="style" type="StyleBox">
  63. The [StyleBox] to display as a background.
  64. </theme_item>
  65. <theme_item name="off" data_type="icon" type="Texture2D">
  66. The icon to display when the [CheckButton] is unchecked (for left-to-right layouts).
  67. </theme_item>
  68. <theme_item name="off_disabled" data_type="icon" type="Texture2D">
  69. The icon to display when the [CheckButton] is unchecked and disabled (for left-to-right layouts).
  70. </theme_item>
  71. <theme_item name="off_disabled_mirrored" data_type="icon" type="Texture2D">
  72. The icon to display when the [CheckButton] is unchecked and disabled (for right-to-left layouts).
  73. </theme_item>
  74. <theme_item name="off_mirrored" data_type="icon" type="Texture2D">
  75. The icon to display when the [CheckButton] is unchecked (for right-to-left layouts).
  76. </theme_item>
  77. <theme_item name="on" data_type="icon" type="Texture2D">
  78. The icon to display when the [CheckButton] is checked (for left-to-right layouts).
  79. </theme_item>
  80. <theme_item name="on_disabled" data_type="icon" type="Texture2D">
  81. The icon to display when the [CheckButton] is checked and disabled (for left-to-right layouts).
  82. </theme_item>
  83. <theme_item name="on_disabled_mirrored" data_type="icon" type="Texture2D">
  84. The icon to display when the [CheckButton] is checked and disabled (for right-to-left layouts).
  85. </theme_item>
  86. <theme_item name="on_mirrored" data_type="icon" type="Texture2D">
  87. The icon to display when the [CheckButton] is checked (for right-to-left layouts).
  88. </theme_item>
  89. <theme_item name="outline_size" data_type="constant" type="int" default="0">
  90. The size of the text outline.
  91. </theme_item>
  92. <theme_item name="pressed" data_type="style" type="StyleBox">
  93. The [StyleBox] to display as a background when the [CheckButton] is pressed.
  94. </theme_item>
  95. </theme_items>
  96. </class>