class_button.rst 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/Button.xml.
  6. .. _class_Button:
  7. Button
  8. ======
  9. **Inherits:** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`CheckBox<class_CheckBox>`, :ref:`CheckButton<class_CheckButton>`, :ref:`ColorPickerButton<class_ColorPickerButton>`, :ref:`MenuButton<class_MenuButton>`, :ref:`OptionButton<class_OptionButton>`
  11. Standard themed Button.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Button is the standard themed button. It can contain text and an icon, and will display them according to the current :ref:`Theme<class_Theme>`.
  16. \ **Example of creating a button and assigning an action when pressed by code:**\
  17. .. tabs::
  18. .. code-tab:: gdscript
  19. func _ready():
  20. var button = Button.new()
  21. button.text = "Click me"
  22. button.pressed.connect(self._button_pressed)
  23. add_child(button)
  24. func _button_pressed():
  25. print("Hello world!")
  26. .. code-tab:: csharp
  27. public override void _Ready()
  28. {
  29. var button = new Button();
  30. button.Text = "Click me";
  31. button.Pressed += ButtonPressed;
  32. AddChild(button);
  33. }
  34. private void ButtonPressed()
  35. {
  36. GD.Print("Hello world!");
  37. }
  38. Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code.
  39. See also :ref:`BaseButton<class_BaseButton>` which contains common properties and methods associated with this node.
  40. \ **Note:** Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use :ref:`TouchScreenButton<class_TouchScreenButton>` for buttons that trigger gameplay movement or actions, as :ref:`TouchScreenButton<class_TouchScreenButton>` supports multitouch.
  41. .. rst-class:: classref-introduction-group
  42. Tutorials
  43. ---------
  44. - `2D Dodge The Creeps Demo <https://godotengine.org/asset-library/asset/515>`__
  45. - `OS Test Demo <https://godotengine.org/asset-library/asset/677>`__
  46. .. rst-class:: classref-reftable-group
  47. Properties
  48. ----------
  49. .. table::
  50. :widths: auto
  51. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  52. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`alignment<class_Button_property_alignment>` | ``1`` |
  53. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  54. | :ref:`bool<class_bool>` | :ref:`clip_text<class_Button_property_clip_text>` | ``false`` |
  55. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  56. | :ref:`bool<class_bool>` | :ref:`expand_icon<class_Button_property_expand_icon>` | ``false`` |
  57. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  58. | :ref:`bool<class_bool>` | :ref:`flat<class_Button_property_flat>` | ``false`` |
  59. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  60. | :ref:`Texture2D<class_Texture2D>` | :ref:`icon<class_Button_property_icon>` | |
  61. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  62. | :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` | :ref:`icon_alignment<class_Button_property_icon_alignment>` | ``0`` |
  63. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  64. | :ref:`String<class_String>` | :ref:`language<class_Button_property_language>` | ``""`` |
  65. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  66. | :ref:`String<class_String>` | :ref:`text<class_Button_property_text>` | ``""`` |
  67. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  68. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`text_direction<class_Button_property_text_direction>` | ``0`` |
  69. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  70. | :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` | :ref:`text_overrun_behavior<class_Button_property_text_overrun_behavior>` | ``0`` |
  71. +-------------------------------------------------------------------+---------------------------------------------------------------------------+-----------+
  72. .. rst-class:: classref-reftable-group
  73. Theme Properties
  74. ----------------
  75. .. table::
  76. :widths: auto
  77. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  78. | :ref:`Color<class_Color>` | :ref:`font_color<class_Button_theme_color_font_color>` | ``Color(0.875, 0.875, 0.875, 1)`` |
  79. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  80. | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_Button_theme_color_font_disabled_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  81. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  82. | :ref:`Color<class_Color>` | :ref:`font_focus_color<class_Button_theme_color_font_focus_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  83. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  84. | :ref:`Color<class_Color>` | :ref:`font_hover_color<class_Button_theme_color_font_hover_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  85. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  86. | :ref:`Color<class_Color>` | :ref:`font_hover_pressed_color<class_Button_theme_color_font_hover_pressed_color>` | ``Color(1, 1, 1, 1)`` |
  87. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  88. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_Button_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
  89. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  90. | :ref:`Color<class_Color>` | :ref:`font_pressed_color<class_Button_theme_color_font_pressed_color>` | ``Color(1, 1, 1, 1)`` |
  91. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  92. | :ref:`Color<class_Color>` | :ref:`icon_disabled_color<class_Button_theme_color_icon_disabled_color>` | ``Color(1, 1, 1, 0.4)`` |
  93. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  94. | :ref:`Color<class_Color>` | :ref:`icon_focus_color<class_Button_theme_color_icon_focus_color>` | ``Color(1, 1, 1, 1)`` |
  95. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  96. | :ref:`Color<class_Color>` | :ref:`icon_hover_color<class_Button_theme_color_icon_hover_color>` | ``Color(1, 1, 1, 1)`` |
  97. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  98. | :ref:`Color<class_Color>` | :ref:`icon_hover_pressed_color<class_Button_theme_color_icon_hover_pressed_color>` | ``Color(1, 1, 1, 1)`` |
  99. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  100. | :ref:`Color<class_Color>` | :ref:`icon_normal_color<class_Button_theme_color_icon_normal_color>` | ``Color(1, 1, 1, 1)`` |
  101. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  102. | :ref:`Color<class_Color>` | :ref:`icon_pressed_color<class_Button_theme_color_icon_pressed_color>` | ``Color(1, 1, 1, 1)`` |
  103. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  104. | :ref:`int<class_int>` | :ref:`h_separation<class_Button_theme_constant_h_separation>` | ``2`` |
  105. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  106. | :ref:`int<class_int>` | :ref:`outline_size<class_Button_theme_constant_outline_size>` | ``0`` |
  107. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  108. | :ref:`Font<class_Font>` | :ref:`font<class_Button_theme_font_font>` | |
  109. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  110. | :ref:`int<class_int>` | :ref:`font_size<class_Button_theme_font_size_font_size>` | |
  111. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  112. | :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_Button_theme_style_disabled>` | |
  113. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  114. | :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_Button_theme_style_focus>` | |
  115. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  116. | :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_Button_theme_style_hover>` | |
  117. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  118. | :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_Button_theme_style_normal>` | |
  119. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  120. | :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_Button_theme_style_pressed>` | |
  121. +---------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  122. .. rst-class:: classref-section-separator
  123. ----
  124. .. rst-class:: classref-descriptions-group
  125. Property Descriptions
  126. ---------------------
  127. .. _class_Button_property_alignment:
  128. .. rst-class:: classref-property
  129. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **alignment** = ``1``
  130. .. rst-class:: classref-property-setget
  131. - void **set_text_alignment** **(** :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` value **)**
  132. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_text_alignment** **(** **)**
  133. Text alignment policy for the button's text, use one of the :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` constants.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. _class_Button_property_clip_text:
  137. .. rst-class:: classref-property
  138. :ref:`bool<class_bool>` **clip_text** = ``false``
  139. .. rst-class:: classref-property-setget
  140. - void **set_clip_text** **(** :ref:`bool<class_bool>` value **)**
  141. - :ref:`bool<class_bool>` **get_clip_text** **(** **)**
  142. When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
  143. .. rst-class:: classref-item-separator
  144. ----
  145. .. _class_Button_property_expand_icon:
  146. .. rst-class:: classref-property
  147. :ref:`bool<class_bool>` **expand_icon** = ``false``
  148. .. rst-class:: classref-property-setget
  149. - void **set_expand_icon** **(** :ref:`bool<class_bool>` value **)**
  150. - :ref:`bool<class_bool>` **is_expand_icon** **(** **)**
  151. When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect.
  152. .. rst-class:: classref-item-separator
  153. ----
  154. .. _class_Button_property_flat:
  155. .. rst-class:: classref-property
  156. :ref:`bool<class_bool>` **flat** = ``false``
  157. .. rst-class:: classref-property-setget
  158. - void **set_flat** **(** :ref:`bool<class_bool>` value **)**
  159. - :ref:`bool<class_bool>` **is_flat** **(** **)**
  160. Flat buttons don't display decoration.
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_Button_property_icon:
  164. .. rst-class:: classref-property
  165. :ref:`Texture2D<class_Texture2D>` **icon**
  166. .. rst-class:: classref-property-setget
  167. - void **set_button_icon** **(** :ref:`Texture2D<class_Texture2D>` value **)**
  168. - :ref:`Texture2D<class_Texture2D>` **get_button_icon** **(** **)**
  169. Button's icon, if text is present the icon will be placed before the text.
  170. To edit margin and spacing of the icon, use :ref:`h_separation<class_Button_theme_constant_h_separation>` theme property and ``content_margin_*`` properties of the used :ref:`StyleBox<class_StyleBox>`\ es.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_Button_property_icon_alignment:
  174. .. rst-class:: classref-property
  175. :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **icon_alignment** = ``0``
  176. .. rst-class:: classref-property-setget
  177. - void **set_icon_alignment** **(** :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` value **)**
  178. - :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` **get_icon_alignment** **(** **)**
  179. Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same :ref:`HorizontalAlignment<enum_@GlobalScope_HorizontalAlignment>` constants as the text alignment. If centered, text will draw on top of the icon.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_Button_property_language:
  183. .. rst-class:: classref-property
  184. :ref:`String<class_String>` **language** = ``""``
  185. .. rst-class:: classref-property-setget
  186. - void **set_language** **(** :ref:`String<class_String>` value **)**
  187. - :ref:`String<class_String>` **get_language** **(** **)**
  188. Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_Button_property_text:
  192. .. rst-class:: classref-property
  193. :ref:`String<class_String>` **text** = ``""``
  194. .. rst-class:: classref-property-setget
  195. - void **set_text** **(** :ref:`String<class_String>` value **)**
  196. - :ref:`String<class_String>` **get_text** **(** **)**
  197. The button's text that will be displayed inside the button's area.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_Button_property_text_direction:
  201. .. rst-class:: classref-property
  202. :ref:`TextDirection<enum_Control_TextDirection>` **text_direction** = ``0``
  203. .. rst-class:: classref-property-setget
  204. - void **set_text_direction** **(** :ref:`TextDirection<enum_Control_TextDirection>` value **)**
  205. - :ref:`TextDirection<enum_Control_TextDirection>` **get_text_direction** **(** **)**
  206. Base text writing direction.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_Button_property_text_overrun_behavior:
  210. .. rst-class:: classref-property
  211. :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **text_overrun_behavior** = ``0``
  212. .. rst-class:: classref-property-setget
  213. - void **set_text_overrun_behavior** **(** :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` value **)**
  214. - :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` **get_text_overrun_behavior** **(** **)**
  215. Sets the clipping behavior when the text exceeds the node's bounding rectangle. See :ref:`OverrunBehavior<enum_TextServer_OverrunBehavior>` for a description of all modes.
  216. .. rst-class:: classref-section-separator
  217. ----
  218. .. rst-class:: classref-descriptions-group
  219. Theme Property Descriptions
  220. ---------------------------
  221. .. _class_Button_theme_color_font_color:
  222. .. rst-class:: classref-themeproperty
  223. :ref:`Color<class_Color>` **font_color** = ``Color(0.875, 0.875, 0.875, 1)``
  224. Default text :ref:`Color<class_Color>` of the **Button**.
  225. .. rst-class:: classref-item-separator
  226. ----
  227. .. _class_Button_theme_color_font_disabled_color:
  228. .. rst-class:: classref-themeproperty
  229. :ref:`Color<class_Color>` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)``
  230. Text :ref:`Color<class_Color>` used when the **Button** is disabled.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_Button_theme_color_font_focus_color:
  234. .. rst-class:: classref-themeproperty
  235. :ref:`Color<class_Color>` **font_focus_color** = ``Color(0.95, 0.95, 0.95, 1)``
  236. Text :ref:`Color<class_Color>` used when the **Button** is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_Button_theme_color_font_hover_color:
  240. .. rst-class:: classref-themeproperty
  241. :ref:`Color<class_Color>` **font_hover_color** = ``Color(0.95, 0.95, 0.95, 1)``
  242. Text :ref:`Color<class_Color>` used when the **Button** is being hovered.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_Button_theme_color_font_hover_pressed_color:
  246. .. rst-class:: classref-themeproperty
  247. :ref:`Color<class_Color>` **font_hover_pressed_color** = ``Color(1, 1, 1, 1)``
  248. Text :ref:`Color<class_Color>` used when the **Button** is being hovered and pressed.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_Button_theme_color_font_outline_color:
  252. .. rst-class:: classref-themeproperty
  253. :ref:`Color<class_Color>` **font_outline_color** = ``Color(1, 1, 1, 1)``
  254. The tint of text outline of the **Button**.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_Button_theme_color_font_pressed_color:
  258. .. rst-class:: classref-themeproperty
  259. :ref:`Color<class_Color>` **font_pressed_color** = ``Color(1, 1, 1, 1)``
  260. Text :ref:`Color<class_Color>` used when the **Button** is being pressed.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_Button_theme_color_icon_disabled_color:
  264. .. rst-class:: classref-themeproperty
  265. :ref:`Color<class_Color>` **icon_disabled_color** = ``Color(1, 1, 1, 0.4)``
  266. Icon modulate :ref:`Color<class_Color>` used when the **Button** is disabled.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_Button_theme_color_icon_focus_color:
  270. .. rst-class:: classref-themeproperty
  271. :ref:`Color<class_Color>` **icon_focus_color** = ``Color(1, 1, 1, 1)``
  272. Icon modulate :ref:`Color<class_Color>` used when the **Button** is focused. Only replaces the normal modulate color of the button. Disabled, hovered, and pressed states take precedence over this color.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_Button_theme_color_icon_hover_color:
  276. .. rst-class:: classref-themeproperty
  277. :ref:`Color<class_Color>` **icon_hover_color** = ``Color(1, 1, 1, 1)``
  278. Icon modulate :ref:`Color<class_Color>` used when the **Button** is being hovered.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_Button_theme_color_icon_hover_pressed_color:
  282. .. rst-class:: classref-themeproperty
  283. :ref:`Color<class_Color>` **icon_hover_pressed_color** = ``Color(1, 1, 1, 1)``
  284. Icon modulate :ref:`Color<class_Color>` used when the **Button** is being hovered and pressed.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_Button_theme_color_icon_normal_color:
  288. .. rst-class:: classref-themeproperty
  289. :ref:`Color<class_Color>` **icon_normal_color** = ``Color(1, 1, 1, 1)``
  290. Default icon modulate :ref:`Color<class_Color>` of the **Button**.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_Button_theme_color_icon_pressed_color:
  294. .. rst-class:: classref-themeproperty
  295. :ref:`Color<class_Color>` **icon_pressed_color** = ``Color(1, 1, 1, 1)``
  296. Icon modulate :ref:`Color<class_Color>` used when the **Button** is being pressed.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_Button_theme_constant_h_separation:
  300. .. rst-class:: classref-themeproperty
  301. :ref:`int<class_int>` **h_separation** = ``2``
  302. The horizontal space between **Button**'s icon and text. Negative values will be treated as ``0`` when used.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_Button_theme_constant_outline_size:
  306. .. rst-class:: classref-themeproperty
  307. :ref:`int<class_int>` **outline_size** = ``0``
  308. The size of the text outline.
  309. \ **Note:** If using a font with :ref:`FontFile.multichannel_signed_distance_field<class_FontFile_property_multichannel_signed_distance_field>` enabled, its :ref:`FontFile.msdf_pixel_range<class_FontFile_property_msdf_pixel_range>` must be set to at least *twice* the value of :ref:`outline_size<class_Button_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_Button_theme_font_font:
  313. .. rst-class:: classref-themeproperty
  314. :ref:`Font<class_Font>` **font**
  315. :ref:`Font<class_Font>` of the **Button**'s text.
  316. .. rst-class:: classref-item-separator
  317. ----
  318. .. _class_Button_theme_font_size_font_size:
  319. .. rst-class:: classref-themeproperty
  320. :ref:`int<class_int>` **font_size**
  321. Font size of the **Button**'s text.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_Button_theme_style_disabled:
  325. .. rst-class:: classref-themeproperty
  326. :ref:`StyleBox<class_StyleBox>` **disabled**
  327. :ref:`StyleBox<class_StyleBox>` used when the **Button** is disabled.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_Button_theme_style_focus:
  331. .. rst-class:: classref-themeproperty
  332. :ref:`StyleBox<class_StyleBox>` **focus**
  333. :ref:`StyleBox<class_StyleBox>` used when the **Button** is focused. The ``focus`` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>`, so a partially transparent :ref:`StyleBox<class_StyleBox>` should be used to ensure the base :ref:`StyleBox<class_StyleBox>` remains visible. A :ref:`StyleBox<class_StyleBox>` that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a :ref:`StyleBoxEmpty<class_StyleBoxEmpty>` resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_Button_theme_style_hover:
  337. .. rst-class:: classref-themeproperty
  338. :ref:`StyleBox<class_StyleBox>` **hover**
  339. :ref:`StyleBox<class_StyleBox>` used when the **Button** is being hovered.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_Button_theme_style_normal:
  343. .. rst-class:: classref-themeproperty
  344. :ref:`StyleBox<class_StyleBox>` **normal**
  345. Default :ref:`StyleBox<class_StyleBox>` for the **Button**.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_Button_theme_style_pressed:
  349. .. rst-class:: classref-themeproperty
  350. :ref:`StyleBox<class_StyleBox>` **pressed**
  351. :ref:`StyleBox<class_StyleBox>` used when the **Button** is being pressed.
  352. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  353. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  354. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  355. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  356. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  357. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`