ColorPickerButton.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ColorPickerButton" inherits="Button" version="4.0">
  3. <brief_description>
  4. Button that pops out a [ColorPicker].
  5. </brief_description>
  6. <description>
  7. Encapsulates a [ColorPicker] making it accessible by pressing a button. Pressing the button will toggle the [ColorPicker] visibility.
  8. See also [BaseButton] which contains common properties and methods associated with this node.
  9. [b]Note:[/b] By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set [member Control.rect_min_size] to a big enough value to give the button enough space.
  10. </description>
  11. <tutorials>
  12. <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/133</link>
  13. <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/517</link>
  14. </tutorials>
  15. <methods>
  16. <method name="get_picker">
  17. <return type="ColorPicker" />
  18. <description>
  19. Returns the [ColorPicker] that this node toggles.
  20. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member CanvasItem.visible] property.
  21. </description>
  22. </method>
  23. <method name="get_popup">
  24. <return type="PopupPanel" />
  25. <description>
  26. Returns the control's [PopupPanel] which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.
  27. [b]Warning:[/b] This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [member Window.visible] property.
  28. </description>
  29. </method>
  30. </methods>
  31. <members>
  32. <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color(0, 0, 0, 1)">
  33. The currently selected color.
  34. </member>
  35. <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
  36. If [code]true[/code], the alpha channel in the displayed [ColorPicker] will be visible.
  37. </member>
  38. <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" override="true" default="true" />
  39. </members>
  40. <signals>
  41. <signal name="color_changed">
  42. <argument index="0" name="color" type="Color" />
  43. <description>
  44. Emitted when the color changes.
  45. </description>
  46. </signal>
  47. <signal name="picker_created">
  48. <description>
  49. Emitted when the [ColorPicker] is created (the button is pressed for the first time).
  50. </description>
  51. </signal>
  52. <signal name="popup_closed">
  53. <description>
  54. Emitted when the [ColorPicker] is closed.
  55. </description>
  56. </signal>
  57. </signals>
  58. <theme_items>
  59. <theme_item name="bg" data_type="icon" type="Texture2D">
  60. The background of the color preview rect on the button.
  61. </theme_item>
  62. <theme_item name="disabled" data_type="style" type="StyleBox">
  63. [StyleBox] used when the [ColorPickerButton] is disabled.
  64. </theme_item>
  65. <theme_item name="focus" data_type="style" type="StyleBox">
  66. [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
  67. </theme_item>
  68. <theme_item name="font" data_type="font" type="Font">
  69. [Font] of the [ColorPickerButton]'s text.
  70. </theme_item>
  71. <theme_item name="font_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  72. Default text [Color] of the [ColorPickerButton].
  73. </theme_item>
  74. <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.9, 0.9, 0.9, 0.3)">
  75. Text [Color] used when the [ColorPickerButton] is disabled.
  76. </theme_item>
  77. <theme_item name="font_focus_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  78. Text [Color] used when the [ColorPickerButton] is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
  79. </theme_item>
  80. <theme_item name="font_hover_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  81. Text [Color] used when the [ColorPickerButton] is being hovered.
  82. </theme_item>
  83. <theme_item name="font_outline_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
  84. The tint of text outline of the [ColorPickerButton].
  85. </theme_item>
  86. <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 1)">
  87. Text [Color] used when the [ColorPickerButton] is being pressed.
  88. </theme_item>
  89. <theme_item name="font_size" data_type="font_size" type="int">
  90. Font size of the [ColorPickerButton]'s text.
  91. </theme_item>
  92. <theme_item name="hover" data_type="style" type="StyleBox">
  93. [StyleBox] used when the [ColorPickerButton] is being hovered.
  94. </theme_item>
  95. <theme_item name="hseparation" data_type="constant" type="int" default="2">
  96. The horizontal space between [ColorPickerButton]'s icon and text.
  97. </theme_item>
  98. <theme_item name="normal" data_type="style" type="StyleBox">
  99. Default [StyleBox] for the [ColorPickerButton].
  100. </theme_item>
  101. <theme_item name="outline_size" data_type="constant" type="int" default="0">
  102. The size of the text outline.
  103. </theme_item>
  104. <theme_item name="pressed" data_type="style" type="StyleBox">
  105. [StyleBox] used when the [ColorPickerButton] is being pressed.
  106. </theme_item>
  107. </theme_items>
  108. </class>