class_toolbutton.rst 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the ToolButton.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_ToolButton:
  6. ToolButton
  7. ==========
  8. **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>`
  9. Flat button helper class.
  10. Description
  11. -----------
  12. 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:
  13. ::
  14. var btn = Button.new()
  15. btn.flat = true
  16. Properties
  17. ----------
  18. +-------------------------+------+------------------------------+
  19. | :ref:`bool<class_bool>` | flat | ``true`` *(parent override)* |
  20. +-------------------------+------+------------------------------+
  21. Theme Properties
  22. ----------------
  23. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  24. | :ref:`Color<class_Color>` | :ref:`font_color<class_ToolButton_theme_color_font_color>` | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  25. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  26. | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_ToolButton_theme_color_font_color_disabled>` | ``Color( 0.9, 0.95, 1, 0.3 )`` |
  27. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  28. | :ref:`Color<class_Color>` | :ref:`font_color_focus<class_ToolButton_theme_color_font_color_focus>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  29. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  30. | :ref:`Color<class_Color>` | :ref:`font_color_hover<class_ToolButton_theme_color_font_color_hover>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  31. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  32. | :ref:`Color<class_Color>` | :ref:`font_color_pressed<class_ToolButton_theme_color_font_color_pressed>` | ``Color( 1, 1, 1, 1 )`` |
  33. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  34. | :ref:`int<class_int>` | :ref:`hseparation<class_ToolButton_theme_constant_hseparation>` | ``3`` |
  35. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  36. | :ref:`Font<class_Font>` | :ref:`font<class_ToolButton_theme_font_font>` | |
  37. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  38. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_ToolButton_theme_style_disabled>` | |
  39. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  40. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_ToolButton_theme_style_focus>` | |
  41. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  42. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_ToolButton_theme_style_hover>` | |
  43. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  44. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_ToolButton_theme_style_normal>` | |
  45. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  46. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_ToolButton_theme_style_pressed>` | |
  47. +---------------------------------+------------------------------------------------------------------------------+----------------------------------+
  48. Theme Property Descriptions
  49. ---------------------------
  50. .. _class_ToolButton_theme_color_font_color:
  51. - :ref:`Color<class_Color>` **font_color**
  52. +-----------+----------------------------------+
  53. | *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` |
  54. +-----------+----------------------------------+
  55. Default text :ref:`Color<class_Color>` of the ``ToolButton``.
  56. ----
  57. .. _class_ToolButton_theme_color_font_color_disabled:
  58. - :ref:`Color<class_Color>` **font_color_disabled**
  59. +-----------+--------------------------------+
  60. | *Default* | ``Color( 0.9, 0.95, 1, 0.3 )`` |
  61. +-----------+--------------------------------+
  62. Text :ref:`Color<class_Color>` used when the ``ToolButton`` is disabled.
  63. ----
  64. .. _class_ToolButton_theme_color_font_color_focus:
  65. - :ref:`Color<class_Color>` **font_color_focus**
  66. +-----------+----------------------------------+
  67. | *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  68. +-----------+----------------------------------+
  69. 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.
  70. ----
  71. .. _class_ToolButton_theme_color_font_color_hover:
  72. - :ref:`Color<class_Color>` **font_color_hover**
  73. +-----------+----------------------------------+
  74. | *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  75. +-----------+----------------------------------+
  76. Text :ref:`Color<class_Color>` used when the ``ToolButton`` is being hovered.
  77. ----
  78. .. _class_ToolButton_theme_color_font_color_pressed:
  79. - :ref:`Color<class_Color>` **font_color_pressed**
  80. +-----------+-------------------------+
  81. | *Default* | ``Color( 1, 1, 1, 1 )`` |
  82. +-----------+-------------------------+
  83. Text :ref:`Color<class_Color>` used when the ``ToolButton`` is being pressed.
  84. ----
  85. .. _class_ToolButton_theme_constant_hseparation:
  86. - :ref:`int<class_int>` **hseparation**
  87. +-----------+-------+
  88. | *Default* | ``3`` |
  89. +-----------+-------+
  90. The horizontal space between ``ToolButton``'s icon and text.
  91. ----
  92. .. _class_ToolButton_theme_font_font:
  93. - :ref:`Font<class_Font>` **font**
  94. :ref:`Font<class_Font>` of the ``ToolButton``'s text.
  95. ----
  96. .. _class_ToolButton_theme_style_disabled:
  97. - :ref:`StyleBox<class_StyleBox>` **disabled**
  98. :ref:`StyleBox<class_StyleBox>` used when the ``ToolButton`` is disabled.
  99. ----
  100. .. _class_ToolButton_theme_style_focus:
  101. - :ref:`StyleBox<class_StyleBox>` **focus**
  102. :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.
  103. ----
  104. .. _class_ToolButton_theme_style_hover:
  105. - :ref:`StyleBox<class_StyleBox>` **hover**
  106. :ref:`StyleBox<class_StyleBox>` used when the ``ToolButton`` is being hovered.
  107. ----
  108. .. _class_ToolButton_theme_style_normal:
  109. - :ref:`StyleBox<class_StyleBox>` **normal**
  110. Default :ref:`StyleBox<class_StyleBox>` for the ``ToolButton``.
  111. ----
  112. .. _class_ToolButton_theme_style_pressed:
  113. - :ref:`StyleBox<class_StyleBox>` **pressed**
  114. :ref:`StyleBox<class_StyleBox>` used when the ``ToolButton`` is being pressed.
  115. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  116. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  117. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`