CheckButton.xml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CheckButton" inherits="Button" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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. <methods>
  13. </methods>
  14. <members>
  15. <member name="align" type="int" setter="set_text_align" getter="get_text_align" overrides="Button" enum="Button.TextAlign" default="0" />
  16. <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
  17. </members>
  18. <constants>
  19. </constants>
  20. <theme_items>
  21. <theme_item name="font_color" data_type="color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
  22. The [CheckButton] text's font color.
  23. </theme_item>
  24. <theme_item name="font_color_disabled" data_type="color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
  25. The [CheckButton] text's font color when it's disabled.
  26. </theme_item>
  27. <theme_item name="font_color_focus" data_type="color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
  28. 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.
  29. </theme_item>
  30. <theme_item name="font_color_hover" data_type="color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
  31. The [CheckButton] text's font color when it's hovered.
  32. </theme_item>
  33. <theme_item name="font_color_hover_pressed" data_type="color" type="Color" default="Color( 1, 1, 1, 1 )">
  34. The [CheckButton] text's font color when it's hovered and pressed.
  35. </theme_item>
  36. <theme_item name="font_color_pressed" data_type="color" type="Color" default="Color( 1, 1, 1, 1 )">
  37. The [CheckButton] text's font color when it's pressed.
  38. </theme_item>
  39. <theme_item name="check_vadjust" data_type="constant" type="int" default="0">
  40. The vertical offset used when rendering the toggle icons (in pixels).
  41. </theme_item>
  42. <theme_item name="hseparation" data_type="constant" type="int" default="4">
  43. The separation between the toggle icon and the text (in pixels).
  44. </theme_item>
  45. <theme_item name="font" data_type="font" type="Font">
  46. The [Font] to use for the [CheckButton] text.
  47. </theme_item>
  48. <theme_item name="off" data_type="icon" type="Texture">
  49. The icon to display when the [CheckButton] is unchecked.
  50. </theme_item>
  51. <theme_item name="off_disabled" data_type="icon" type="Texture">
  52. The icon to display when the [CheckButton] is unchecked and disabled.
  53. </theme_item>
  54. <theme_item name="on" data_type="icon" type="Texture">
  55. The icon to display when the [CheckButton] is checked.
  56. </theme_item>
  57. <theme_item name="on_disabled" data_type="icon" type="Texture">
  58. The icon to display when the [CheckButton] is checked and disabled.
  59. </theme_item>
  60. <theme_item name="disabled" data_type="style" type="StyleBox">
  61. The [StyleBox] to display as a background when the [CheckButton] is disabled.
  62. </theme_item>
  63. <theme_item name="focus" data_type="style" type="StyleBox">
  64. The [StyleBox] to display as a background when the [CheckButton] is focused.
  65. </theme_item>
  66. <theme_item name="hover" data_type="style" type="StyleBox">
  67. The [StyleBox] to display as a background when the [CheckButton] is hovered.
  68. </theme_item>
  69. <theme_item name="hover_pressed" data_type="style" type="StyleBox">
  70. The [StyleBox] to display as a background when the [CheckButton] is hovered and pressed.
  71. </theme_item>
  72. <theme_item name="normal" data_type="style" type="StyleBox">
  73. The [StyleBox] to display as a background.
  74. </theme_item>
  75. <theme_item name="pressed" data_type="style" type="StyleBox">
  76. The [StyleBox] to display as a background when the [CheckButton] is pressed.
  77. </theme_item>
  78. </theme_items>
  79. </class>