ColorPickerButton.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="ColorPickerButton" inherits="Button" version="3.4">
  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 CanvasItem.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. <constants>
  59. </constants>
  60. <theme_items>
  61. <theme_item name="bg" data_type="icon" type="Texture">
  62. The background of the color preview rect on the button.
  63. </theme_item>
  64. <theme_item name="disabled" data_type="style" type="StyleBox">
  65. [StyleBox] used when the [ColorPickerButton] is disabled.
  66. </theme_item>
  67. <theme_item name="focus" data_type="style" type="StyleBox">
  68. [StyleBox] used when the [ColorPickerButton] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
  69. </theme_item>
  70. <theme_item name="font" data_type="font" type="Font">
  71. [Font] of the [ColorPickerButton]'s text.
  72. </theme_item>
  73. <theme_item name="font_color" data_type="color" type="Color" default="Color( 1, 1, 1, 1 )">
  74. Default text [Color] of the [ColorPickerButton].
  75. </theme_item>
  76. <theme_item name="font_color_disabled" data_type="color" type="Color" default="Color( 0.9, 0.9, 0.9, 0.3 )">
  77. Text [Color] used when the [ColorPickerButton] is disabled.
  78. </theme_item>
  79. <theme_item name="font_color_focus" data_type="color" type="Color" default="Color( 1, 1, 1, 1 )">
  80. 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.
  81. </theme_item>
  82. <theme_item name="font_color_hover" data_type="color" type="Color" default="Color( 1, 1, 1, 1 )">
  83. Text [Color] used when the [ColorPickerButton] is being hovered.
  84. </theme_item>
  85. <theme_item name="font_color_pressed" data_type="color" type="Color" default="Color( 0.8, 0.8, 0.8, 1 )">
  86. Text [Color] used when the [ColorPickerButton] is being pressed.
  87. </theme_item>
  88. <theme_item name="hover" data_type="style" type="StyleBox">
  89. [StyleBox] used when the [ColorPickerButton] is being hovered.
  90. </theme_item>
  91. <theme_item name="hseparation" data_type="constant" type="int" default="2">
  92. The horizontal space between [ColorPickerButton]'s icon and text.
  93. </theme_item>
  94. <theme_item name="normal" data_type="style" type="StyleBox">
  95. Default [StyleBox] for the [ColorPickerButton].
  96. </theme_item>
  97. <theme_item name="pressed" data_type="style" type="StyleBox">
  98. [StyleBox] used when the [ColorPickerButton] is being pressed.
  99. </theme_item>
  100. </theme_items>
  101. </class>