class_toolbutton.rst 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/ToolButton.xml.
  6. .. _class_ToolButton:
  7. ToolButton
  8. ==========
  9. **Inherits:** :ref:`Button<class_Button>` **<** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Flat button helper class.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This is a helper class to generate a flat :ref:`Button<class_Button>` (see :ref:`Button.flat<class_Button_property_flat>`), creating a **ToolButton** is equivalent to:
  15. ::
  16. var btn = Button.new()
  17. btn.flat = true
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------+------+----------------------------------------------------------------+
  24. | :ref:`bool<class_bool>` | flat | ``true`` (overrides :ref:`Button<class_Button_property_flat>`) |
  25. +-------------------------+------+----------------------------------------------------------------+
  26. .. rst-class:: classref-reftable-group
  27. Theme Properties
  28. ----------------
  29. .. table::
  30. :widths: auto
  31. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  32. | :ref:`Color<class_Color>` | :ref:`font_color<class_ToolButton_theme_color_font_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  33. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  34. | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_ToolButton_theme_color_font_color_disabled>` | ``Color( 0.9, 0.95, 1, 0.3 )`` |
  35. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  36. | :ref:`Color<class_Color>` | :ref:`font_color_focus<class_ToolButton_theme_color_font_color_focus>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  37. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  38. | :ref:`Color<class_Color>` | :ref:`font_color_hover<class_ToolButton_theme_color_font_color_hover>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  39. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  40. | :ref:`Color<class_Color>` | :ref:`font_color_pressed<class_ToolButton_theme_color_font_color_pressed>` | ``Color( 1, 1, 1, 1 )`` |
  41. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  42. | :ref:`int<class_int>` | :ref:`hseparation<class_ToolButton_theme_constant_hseparation>` | ``3`` |
  43. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  44. | :ref:`Font<class_Font>` | :ref:`font<class_ToolButton_theme_font_font>` | |
  45. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  46. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_ToolButton_theme_style_disabled>` | |
  47. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  48. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_ToolButton_theme_style_focus>` | |
  49. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  50. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_ToolButton_theme_style_hover>` | |
  51. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  52. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_ToolButton_theme_style_normal>` | |
  53. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  54. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_ToolButton_theme_style_pressed>` | |
  55. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  56. .. rst-class:: classref-section-separator
  57. ----
  58. .. rst-class:: classref-descriptions-group
  59. Theme Property Descriptions
  60. ---------------------------
  61. .. _class_ToolButton_theme_color_font_color:
  62. .. rst-class:: classref-themeproperty
  63. :ref:`Color<class_Color>` **font_color** = ``Color( 0.88, 0.88, 0.88, 1 )``
  64. Default text :ref:`Color<class_Color>` of the **ToolButton**.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_ToolButton_theme_color_font_color_disabled:
  68. .. rst-class:: classref-themeproperty
  69. :ref:`Color<class_Color>` **font_color_disabled** = ``Color( 0.9, 0.95, 1, 0.3 )``
  70. Text :ref:`Color<class_Color>` used when the **ToolButton** is disabled.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_ToolButton_theme_color_font_color_focus:
  74. .. rst-class:: classref-themeproperty
  75. :ref:`Color<class_Color>` **font_color_focus** = ``Color( 0.94, 0.94, 0.94, 1 )``
  76. Text :ref:`Color<class_Color>` used when the **ToolButton** is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_ToolButton_theme_color_font_color_hover:
  80. .. rst-class:: classref-themeproperty
  81. :ref:`Color<class_Color>` **font_color_hover** = ``Color( 0.94, 0.94, 0.94, 1 )``
  82. Text :ref:`Color<class_Color>` used when the **ToolButton** is being hovered.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_ToolButton_theme_color_font_color_pressed:
  86. .. rst-class:: classref-themeproperty
  87. :ref:`Color<class_Color>` **font_color_pressed** = ``Color( 1, 1, 1, 1 )``
  88. Text :ref:`Color<class_Color>` used when the **ToolButton** is being pressed.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_ToolButton_theme_constant_hseparation:
  92. .. rst-class:: classref-themeproperty
  93. :ref:`int<class_int>` **hseparation** = ``3``
  94. The horizontal space between **ToolButton**'s icon and text.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_ToolButton_theme_font_font:
  98. .. rst-class:: classref-themeproperty
  99. :ref:`Font<class_Font>` **font**
  100. :ref:`Font<class_Font>` of the **ToolButton**'s text.
  101. .. rst-class:: classref-item-separator
  102. ----
  103. .. _class_ToolButton_theme_style_disabled:
  104. .. rst-class:: classref-themeproperty
  105. :ref:`StyleBox<class_StyleBox>` **disabled**
  106. :ref:`StyleBox<class_StyleBox>` used when the **ToolButton** is disabled.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_ToolButton_theme_style_focus:
  110. .. rst-class:: classref-themeproperty
  111. :ref:`StyleBox<class_StyleBox>` **focus**
  112. :ref:`StyleBox<class_StyleBox>` used when the **ToolButton** is focused. It is displayed over the current :ref:`StyleBox<class_StyleBox>`, so using :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` will just disable the focus visual effect.
  113. .. rst-class:: classref-item-separator
  114. ----
  115. .. _class_ToolButton_theme_style_hover:
  116. .. rst-class:: classref-themeproperty
  117. :ref:`StyleBox<class_StyleBox>` **hover**
  118. :ref:`StyleBox<class_StyleBox>` used when the **ToolButton** is being hovered.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _class_ToolButton_theme_style_normal:
  122. .. rst-class:: classref-themeproperty
  123. :ref:`StyleBox<class_StyleBox>` **normal**
  124. Default :ref:`StyleBox<class_StyleBox>` for the **ToolButton**.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_ToolButton_theme_style_pressed:
  128. .. rst-class:: classref-themeproperty
  129. :ref:`StyleBox<class_StyleBox>` **pressed**
  130. :ref:`StyleBox<class_StyleBox>` used when the **ToolButton** is being pressed.
  131. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  132. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  133. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  134. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`