class_tabcontainer.rst 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198
  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/TabContainer.xml.
  6. .. _class_TabContainer:
  7. TabContainer
  8. ============
  9. **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A container that creates a tab for each child control, displaying only the active tab's control.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Arranges child controls into a tabbed view, creating a tab for each one. The active tab's corresponding control is made visible, while all other child controls are hidden. Ignores non-control children.
  15. \ **Note:** The drawing of the clickable tabs is handled by this node; :ref:`TabBar<class_TabBar>` is not needed.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`Using Containers <../tutorials/ui/gui_containers>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  26. | :ref:`bool<class_bool>` | :ref:`all_tabs_in_front<class_TabContainer_property_all_tabs_in_front>` | ``false`` |
  27. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  28. | :ref:`bool<class_bool>` | :ref:`clip_tabs<class_TabContainer_property_clip_tabs>` | ``true`` |
  29. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  30. | :ref:`int<class_int>` | :ref:`current_tab<class_TabContainer_property_current_tab>` | ``-1`` |
  31. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  32. | :ref:`bool<class_bool>` | :ref:`deselect_enabled<class_TabContainer_property_deselect_enabled>` | ``false`` |
  33. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  34. | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>` | ``false`` |
  35. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  36. | :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` | :ref:`tab_alignment<class_TabContainer_property_tab_alignment>` | ``0`` |
  37. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  38. | :ref:`FocusMode<enum_Control_FocusMode>` | :ref:`tab_focus_mode<class_TabContainer_property_tab_focus_mode>` | ``2`` |
  39. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  40. | :ref:`TabPosition<enum_TabContainer_TabPosition>` | :ref:`tabs_position<class_TabContainer_property_tabs_position>` | ``0`` |
  41. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  42. | :ref:`int<class_int>` | :ref:`tabs_rearrange_group<class_TabContainer_property_tabs_rearrange_group>` | ``-1`` |
  43. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  44. | :ref:`bool<class_bool>` | :ref:`tabs_visible<class_TabContainer_property_tabs_visible>` | ``true`` |
  45. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  46. | :ref:`bool<class_bool>` | :ref:`use_hidden_tabs_for_min_size<class_TabContainer_property_use_hidden_tabs_for_min_size>` | ``false`` |
  47. +---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  48. .. rst-class:: classref-reftable-group
  49. Methods
  50. -------
  51. .. table::
  52. :widths: auto
  53. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Control<class_Control>` | :ref:`get_current_tab_control<class_TabContainer_method_get_current_tab_control>`\ (\ ) |const| |
  55. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Popup<class_Popup>` | :ref:`get_popup<class_TabContainer_method_get_popup>`\ (\ ) |const| |
  57. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabContainer_method_get_previous_tab>`\ (\ ) |const| |
  59. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`TabBar<class_TabBar>` | :ref:`get_tab_bar<class_TabContainer_method_get_tab_bar>`\ (\ ) |const| |
  61. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_tab_button_icon<class_TabContainer_method_get_tab_button_icon>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  63. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Control<class_Control>` | :ref:`get_tab_control<class_TabContainer_method_get_tab_control>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  65. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`int<class_int>` | :ref:`get_tab_count<class_TabContainer_method_get_tab_count>`\ (\ ) |const| |
  67. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_tab_icon<class_TabContainer_method_get_tab_icon>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  69. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`int<class_int>` | :ref:`get_tab_icon_max_width<class_TabContainer_method_get_tab_icon_max_width>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  71. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`int<class_int>` | :ref:`get_tab_idx_at_point<class_TabContainer_method_get_tab_idx_at_point>`\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  73. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`int<class_int>` | :ref:`get_tab_idx_from_control<class_TabContainer_method_get_tab_idx_from_control>`\ (\ control\: :ref:`Control<class_Control>`\ ) |const| |
  75. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`Variant<class_Variant>` | :ref:`get_tab_metadata<class_TabContainer_method_get_tab_metadata>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  77. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`String<class_String>` | :ref:`get_tab_title<class_TabContainer_method_get_tab_title>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  79. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`String<class_String>` | :ref:`get_tab_tooltip<class_TabContainer_method_get_tab_tooltip>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  81. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`bool<class_bool>` | :ref:`is_tab_disabled<class_TabContainer_method_is_tab_disabled>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  83. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`is_tab_hidden<class_TabContainer_method_is_tab_hidden>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  85. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`select_next_available<class_TabContainer_method_select_next_available>`\ (\ ) |
  87. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`select_previous_available<class_TabContainer_method_select_previous_available>`\ (\ ) |
  89. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | |void| | :ref:`set_popup<class_TabContainer_method_set_popup>`\ (\ popup\: :ref:`Node<class_Node>`\ ) |
  91. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | |void| | :ref:`set_tab_button_icon<class_TabContainer_method_set_tab_button_icon>`\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
  93. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | |void| | :ref:`set_tab_disabled<class_TabContainer_method_set_tab_disabled>`\ (\ tab_idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) |
  95. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | |void| | :ref:`set_tab_hidden<class_TabContainer_method_set_tab_hidden>`\ (\ tab_idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ ) |
  97. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | |void| | :ref:`set_tab_icon<class_TabContainer_method_set_tab_icon>`\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
  99. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | |void| | :ref:`set_tab_icon_max_width<class_TabContainer_method_set_tab_icon_max_width>`\ (\ tab_idx\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) |
  101. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | |void| | :ref:`set_tab_metadata<class_TabContainer_method_set_tab_metadata>`\ (\ tab_idx\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) |
  103. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | |void| | :ref:`set_tab_title<class_TabContainer_method_set_tab_title>`\ (\ tab_idx\: :ref:`int<class_int>`, title\: :ref:`String<class_String>`\ ) |
  105. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | |void| | :ref:`set_tab_tooltip<class_TabContainer_method_set_tab_tooltip>`\ (\ tab_idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) |
  107. +-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. .. rst-class:: classref-reftable-group
  109. Theme Properties
  110. ----------------
  111. .. table::
  112. :widths: auto
  113. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  114. | :ref:`Color<class_Color>` | :ref:`drop_mark_color<class_TabContainer_theme_color_drop_mark_color>` | ``Color(1, 1, 1, 1)`` |
  115. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  116. | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_TabContainer_theme_color_font_disabled_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  117. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  118. | :ref:`Color<class_Color>` | :ref:`font_hovered_color<class_TabContainer_theme_color_font_hovered_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  119. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  120. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TabContainer_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  121. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  122. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TabContainer_theme_color_font_selected_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  123. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  124. | :ref:`Color<class_Color>` | :ref:`font_unselected_color<class_TabContainer_theme_color_font_unselected_color>` | ``Color(0.7, 0.7, 0.7, 1)`` |
  125. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  126. | :ref:`int<class_int>` | :ref:`icon_max_width<class_TabContainer_theme_constant_icon_max_width>` | ``0`` |
  127. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  128. | :ref:`int<class_int>` | :ref:`icon_separation<class_TabContainer_theme_constant_icon_separation>` | ``4`` |
  129. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  130. | :ref:`int<class_int>` | :ref:`outline_size<class_TabContainer_theme_constant_outline_size>` | ``0`` |
  131. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  132. | :ref:`int<class_int>` | :ref:`side_margin<class_TabContainer_theme_constant_side_margin>` | ``8`` |
  133. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  134. | :ref:`int<class_int>` | :ref:`tab_separation<class_TabContainer_theme_constant_tab_separation>` | ``0`` |
  135. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  136. | :ref:`Font<class_Font>` | :ref:`font<class_TabContainer_theme_font_font>` | |
  137. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  138. | :ref:`int<class_int>` | :ref:`font_size<class_TabContainer_theme_font_size_font_size>` | |
  139. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  140. | :ref:`Texture2D<class_Texture2D>` | :ref:`decrement<class_TabContainer_theme_icon_decrement>` | |
  141. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  142. | :ref:`Texture2D<class_Texture2D>` | :ref:`decrement_highlight<class_TabContainer_theme_icon_decrement_highlight>` | |
  143. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  144. | :ref:`Texture2D<class_Texture2D>` | :ref:`drop_mark<class_TabContainer_theme_icon_drop_mark>` | |
  145. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  146. | :ref:`Texture2D<class_Texture2D>` | :ref:`increment<class_TabContainer_theme_icon_increment>` | |
  147. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  148. | :ref:`Texture2D<class_Texture2D>` | :ref:`increment_highlight<class_TabContainer_theme_icon_increment_highlight>` | |
  149. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  150. | :ref:`Texture2D<class_Texture2D>` | :ref:`menu<class_TabContainer_theme_icon_menu>` | |
  151. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  152. | :ref:`Texture2D<class_Texture2D>` | :ref:`menu_highlight<class_TabContainer_theme_icon_menu_highlight>` | |
  153. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  154. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_TabContainer_theme_style_panel>` | |
  155. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  156. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_disabled<class_TabContainer_theme_style_tab_disabled>` | |
  157. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  158. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_focus<class_TabContainer_theme_style_tab_focus>` | |
  159. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  160. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_hovered<class_TabContainer_theme_style_tab_hovered>` | |
  161. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  162. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_selected<class_TabContainer_theme_style_tab_selected>` | |
  163. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  164. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_unselected<class_TabContainer_theme_style_tab_unselected>` | |
  165. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  166. | :ref:`StyleBox<class_StyleBox>` | :ref:`tabbar_background<class_TabContainer_theme_style_tabbar_background>` | |
  167. +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
  168. .. rst-class:: classref-section-separator
  169. ----
  170. .. rst-class:: classref-descriptions-group
  171. Signals
  172. -------
  173. .. _class_TabContainer_signal_active_tab_rearranged:
  174. .. rst-class:: classref-signal
  175. **active_tab_rearranged**\ (\ idx_to\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_signal_active_tab_rearranged>`
  176. Emitted when the active tab is rearranged via mouse drag. See :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_TabContainer_signal_pre_popup_pressed:
  180. .. rst-class:: classref-signal
  181. **pre_popup_pressed**\ (\ ) :ref:`🔗<class_TabContainer_signal_pre_popup_pressed>`
  182. Emitted when the **TabContainer**'s :ref:`Popup<class_Popup>` button is clicked. See :ref:`set_popup()<class_TabContainer_method_set_popup>` for details.
  183. .. rst-class:: classref-item-separator
  184. ----
  185. .. _class_TabContainer_signal_tab_button_pressed:
  186. .. rst-class:: classref-signal
  187. **tab_button_pressed**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_signal_tab_button_pressed>`
  188. Emitted when the user clicks on the button icon on this tab.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_TabContainer_signal_tab_changed:
  192. .. rst-class:: classref-signal
  193. **tab_changed**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_signal_tab_changed>`
  194. Emitted when switching to another tab.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_TabContainer_signal_tab_clicked:
  198. .. rst-class:: classref-signal
  199. **tab_clicked**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_signal_tab_clicked>`
  200. Emitted when a tab is clicked, even if it is the current tab.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_TabContainer_signal_tab_hovered:
  204. .. rst-class:: classref-signal
  205. **tab_hovered**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_signal_tab_hovered>`
  206. Emitted when a tab is hovered by the mouse.
  207. .. rst-class:: classref-item-separator
  208. ----
  209. .. _class_TabContainer_signal_tab_selected:
  210. .. rst-class:: classref-signal
  211. **tab_selected**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_signal_tab_selected>`
  212. Emitted when a tab is selected via click, directional input, or script, even if it is the current tab.
  213. .. rst-class:: classref-section-separator
  214. ----
  215. .. rst-class:: classref-descriptions-group
  216. Enumerations
  217. ------------
  218. .. _enum_TabContainer_TabPosition:
  219. .. rst-class:: classref-enumeration
  220. enum **TabPosition**: :ref:`🔗<enum_TabContainer_TabPosition>`
  221. .. _class_TabContainer_constant_POSITION_TOP:
  222. .. rst-class:: classref-enumeration-constant
  223. :ref:`TabPosition<enum_TabContainer_TabPosition>` **POSITION_TOP** = ``0``
  224. Places the tab bar at the top.
  225. .. _class_TabContainer_constant_POSITION_BOTTOM:
  226. .. rst-class:: classref-enumeration-constant
  227. :ref:`TabPosition<enum_TabContainer_TabPosition>` **POSITION_BOTTOM** = ``1``
  228. Places the tab bar at the bottom. The tab bar's :ref:`StyleBox<class_StyleBox>` will be flipped vertically.
  229. .. _class_TabContainer_constant_POSITION_MAX:
  230. .. rst-class:: classref-enumeration-constant
  231. :ref:`TabPosition<enum_TabContainer_TabPosition>` **POSITION_MAX** = ``2``
  232. Represents the size of the :ref:`TabPosition<enum_TabContainer_TabPosition>` enum.
  233. .. rst-class:: classref-section-separator
  234. ----
  235. .. rst-class:: classref-descriptions-group
  236. Property Descriptions
  237. ---------------------
  238. .. _class_TabContainer_property_all_tabs_in_front:
  239. .. rst-class:: classref-property
  240. :ref:`bool<class_bool>` **all_tabs_in_front** = ``false`` :ref:`🔗<class_TabContainer_property_all_tabs_in_front>`
  241. .. rst-class:: classref-property-setget
  242. - |void| **set_all_tabs_in_front**\ (\ value\: :ref:`bool<class_bool>`\ )
  243. - :ref:`bool<class_bool>` **is_all_tabs_in_front**\ (\ )
  244. If ``true``, all tabs are drawn in front of the panel. If ``false``, inactive tabs are drawn behind the panel.
  245. .. rst-class:: classref-item-separator
  246. ----
  247. .. _class_TabContainer_property_clip_tabs:
  248. .. rst-class:: classref-property
  249. :ref:`bool<class_bool>` **clip_tabs** = ``true`` :ref:`🔗<class_TabContainer_property_clip_tabs>`
  250. .. rst-class:: classref-property-setget
  251. - |void| **set_clip_tabs**\ (\ value\: :ref:`bool<class_bool>`\ )
  252. - :ref:`bool<class_bool>` **get_clip_tabs**\ (\ )
  253. If ``true``, tabs overflowing this node's width will be hidden, displaying two navigation buttons instead. Otherwise, this node's minimum size is updated so that all tabs are visible.
  254. .. rst-class:: classref-item-separator
  255. ----
  256. .. _class_TabContainer_property_current_tab:
  257. .. rst-class:: classref-property
  258. :ref:`int<class_int>` **current_tab** = ``-1`` :ref:`🔗<class_TabContainer_property_current_tab>`
  259. .. rst-class:: classref-property-setget
  260. - |void| **set_current_tab**\ (\ value\: :ref:`int<class_int>`\ )
  261. - :ref:`int<class_int>` **get_current_tab**\ (\ )
  262. The current tab index. When set, this index's :ref:`Control<class_Control>` node's ``visible`` property is set to ``true`` and all others are set to ``false``.
  263. A value of ``-1`` means that no tab is selected.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_TabContainer_property_deselect_enabled:
  267. .. rst-class:: classref-property
  268. :ref:`bool<class_bool>` **deselect_enabled** = ``false`` :ref:`🔗<class_TabContainer_property_deselect_enabled>`
  269. .. rst-class:: classref-property-setget
  270. - |void| **set_deselect_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  271. - :ref:`bool<class_bool>` **get_deselect_enabled**\ (\ )
  272. If ``true``, all tabs can be deselected so that no tab is selected. Click on the :ref:`current_tab<class_TabContainer_property_current_tab>` to deselect it.
  273. Only the tab header will be shown if no tabs are selected.
  274. .. rst-class:: classref-item-separator
  275. ----
  276. .. _class_TabContainer_property_drag_to_rearrange_enabled:
  277. .. rst-class:: classref-property
  278. :ref:`bool<class_bool>` **drag_to_rearrange_enabled** = ``false`` :ref:`🔗<class_TabContainer_property_drag_to_rearrange_enabled>`
  279. .. rst-class:: classref-property-setget
  280. - |void| **set_drag_to_rearrange_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  281. - :ref:`bool<class_bool>` **get_drag_to_rearrange_enabled**\ (\ )
  282. If ``true``, tabs can be rearranged with mouse drag.
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_TabContainer_property_tab_alignment:
  286. .. rst-class:: classref-property
  287. :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **tab_alignment** = ``0`` :ref:`🔗<class_TabContainer_property_tab_alignment>`
  288. .. rst-class:: classref-property-setget
  289. - |void| **set_tab_alignment**\ (\ value\: :ref:`AlignmentMode<enum_TabBar_AlignmentMode>`\ )
  290. - :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **get_tab_alignment**\ (\ )
  291. The position at which tabs will be placed.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_TabContainer_property_tab_focus_mode:
  295. .. rst-class:: classref-property
  296. :ref:`FocusMode<enum_Control_FocusMode>` **tab_focus_mode** = ``2`` :ref:`🔗<class_TabContainer_property_tab_focus_mode>`
  297. .. rst-class:: classref-property-setget
  298. - |void| **set_tab_focus_mode**\ (\ value\: :ref:`FocusMode<enum_Control_FocusMode>`\ )
  299. - :ref:`FocusMode<enum_Control_FocusMode>` **get_tab_focus_mode**\ (\ )
  300. The focus access mode for the internal :ref:`TabBar<class_TabBar>` node.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_TabContainer_property_tabs_position:
  304. .. rst-class:: classref-property
  305. :ref:`TabPosition<enum_TabContainer_TabPosition>` **tabs_position** = ``0`` :ref:`🔗<class_TabContainer_property_tabs_position>`
  306. .. rst-class:: classref-property-setget
  307. - |void| **set_tabs_position**\ (\ value\: :ref:`TabPosition<enum_TabContainer_TabPosition>`\ )
  308. - :ref:`TabPosition<enum_TabContainer_TabPosition>` **get_tabs_position**\ (\ )
  309. The position of the tab bar.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_TabContainer_property_tabs_rearrange_group:
  313. .. rst-class:: classref-property
  314. :ref:`int<class_int>` **tabs_rearrange_group** = ``-1`` :ref:`🔗<class_TabContainer_property_tabs_rearrange_group>`
  315. .. rst-class:: classref-property-setget
  316. - |void| **set_tabs_rearrange_group**\ (\ value\: :ref:`int<class_int>`\ )
  317. - :ref:`int<class_int>` **get_tabs_rearrange_group**\ (\ )
  318. **TabContainer**\ s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`.
  319. Setting this to ``-1`` will disable rearranging between **TabContainer**\ s.
  320. .. rst-class:: classref-item-separator
  321. ----
  322. .. _class_TabContainer_property_tabs_visible:
  323. .. rst-class:: classref-property
  324. :ref:`bool<class_bool>` **tabs_visible** = ``true`` :ref:`🔗<class_TabContainer_property_tabs_visible>`
  325. .. rst-class:: classref-property-setget
  326. - |void| **set_tabs_visible**\ (\ value\: :ref:`bool<class_bool>`\ )
  327. - :ref:`bool<class_bool>` **are_tabs_visible**\ (\ )
  328. If ``true``, tabs are visible. If ``false``, tabs' content and titles are hidden.
  329. .. rst-class:: classref-item-separator
  330. ----
  331. .. _class_TabContainer_property_use_hidden_tabs_for_min_size:
  332. .. rst-class:: classref-property
  333. :ref:`bool<class_bool>` **use_hidden_tabs_for_min_size** = ``false`` :ref:`🔗<class_TabContainer_property_use_hidden_tabs_for_min_size>`
  334. .. rst-class:: classref-property-setget
  335. - |void| **set_use_hidden_tabs_for_min_size**\ (\ value\: :ref:`bool<class_bool>`\ )
  336. - :ref:`bool<class_bool>` **get_use_hidden_tabs_for_min_size**\ (\ )
  337. If ``true``, child :ref:`Control<class_Control>` nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.
  338. .. rst-class:: classref-section-separator
  339. ----
  340. .. rst-class:: classref-descriptions-group
  341. Method Descriptions
  342. -------------------
  343. .. _class_TabContainer_method_get_current_tab_control:
  344. .. rst-class:: classref-method
  345. :ref:`Control<class_Control>` **get_current_tab_control**\ (\ ) |const| :ref:`🔗<class_TabContainer_method_get_current_tab_control>`
  346. Returns the child :ref:`Control<class_Control>` node located at the active tab index.
  347. .. rst-class:: classref-item-separator
  348. ----
  349. .. _class_TabContainer_method_get_popup:
  350. .. rst-class:: classref-method
  351. :ref:`Popup<class_Popup>` **get_popup**\ (\ ) |const| :ref:`🔗<class_TabContainer_method_get_popup>`
  352. Returns the :ref:`Popup<class_Popup>` node instance if one has been set already with :ref:`set_popup()<class_TabContainer_method_set_popup>`.
  353. \ **Warning:** 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 :ref:`Window.visible<class_Window_property_visible>` property.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_TabContainer_method_get_previous_tab:
  357. .. rst-class:: classref-method
  358. :ref:`int<class_int>` **get_previous_tab**\ (\ ) |const| :ref:`🔗<class_TabContainer_method_get_previous_tab>`
  359. Returns the previously active tab index.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_TabContainer_method_get_tab_bar:
  363. .. rst-class:: classref-method
  364. :ref:`TabBar<class_TabBar>` **get_tab_bar**\ (\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_bar>`
  365. Returns the :ref:`TabBar<class_TabBar>` contained in this container.
  366. \ **Warning:** This is a required internal node, removing and freeing it or editing its tabs may cause a crash. If you wish to edit the tabs, use the methods provided in **TabContainer**.
  367. .. rst-class:: classref-item-separator
  368. ----
  369. .. _class_TabContainer_method_get_tab_button_icon:
  370. .. rst-class:: classref-method
  371. :ref:`Texture2D<class_Texture2D>` **get_tab_button_icon**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_button_icon>`
  372. Returns the button icon from the tab at index ``tab_idx``.
  373. .. rst-class:: classref-item-separator
  374. ----
  375. .. _class_TabContainer_method_get_tab_control:
  376. .. rst-class:: classref-method
  377. :ref:`Control<class_Control>` **get_tab_control**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_control>`
  378. Returns the :ref:`Control<class_Control>` node from the tab at index ``tab_idx``.
  379. .. rst-class:: classref-item-separator
  380. ----
  381. .. _class_TabContainer_method_get_tab_count:
  382. .. rst-class:: classref-method
  383. :ref:`int<class_int>` **get_tab_count**\ (\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_count>`
  384. Returns the number of tabs.
  385. .. rst-class:: classref-item-separator
  386. ----
  387. .. _class_TabContainer_method_get_tab_icon:
  388. .. rst-class:: classref-method
  389. :ref:`Texture2D<class_Texture2D>` **get_tab_icon**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_icon>`
  390. Returns the :ref:`Texture2D<class_Texture2D>` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture2D<class_Texture2D>`.
  391. .. rst-class:: classref-item-separator
  392. ----
  393. .. _class_TabContainer_method_get_tab_icon_max_width:
  394. .. rst-class:: classref-method
  395. :ref:`int<class_int>` **get_tab_icon_max_width**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_icon_max_width>`
  396. Returns the maximum allowed width of the icon for the tab at index ``tab_idx``.
  397. .. rst-class:: classref-item-separator
  398. ----
  399. .. _class_TabContainer_method_get_tab_idx_at_point:
  400. .. rst-class:: classref-method
  401. :ref:`int<class_int>` **get_tab_idx_at_point**\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_idx_at_point>`
  402. Returns the index of the tab at local coordinates ``point``. Returns ``-1`` if the point is outside the control boundaries or if there's no tab at the queried position.
  403. .. rst-class:: classref-item-separator
  404. ----
  405. .. _class_TabContainer_method_get_tab_idx_from_control:
  406. .. rst-class:: classref-method
  407. :ref:`int<class_int>` **get_tab_idx_from_control**\ (\ control\: :ref:`Control<class_Control>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_idx_from_control>`
  408. Returns the index of the tab tied to the given ``control``. The control must be a child of the **TabContainer**.
  409. .. rst-class:: classref-item-separator
  410. ----
  411. .. _class_TabContainer_method_get_tab_metadata:
  412. .. rst-class:: classref-method
  413. :ref:`Variant<class_Variant>` **get_tab_metadata**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_metadata>`
  414. Returns the metadata value set to the tab at index ``tab_idx`` using :ref:`set_tab_metadata()<class_TabContainer_method_set_tab_metadata>`. If no metadata was previously set, returns ``null`` by default.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_TabContainer_method_get_tab_title:
  418. .. rst-class:: classref-method
  419. :ref:`String<class_String>` **get_tab_title**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_title>`
  420. Returns the title of the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node, but this can be overridden with :ref:`set_tab_title()<class_TabContainer_method_set_tab_title>`.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_TabContainer_method_get_tab_tooltip:
  424. .. rst-class:: classref-method
  425. :ref:`String<class_String>` **get_tab_tooltip**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_get_tab_tooltip>`
  426. Returns the tooltip text of the tab at index ``tab_idx``.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_TabContainer_method_is_tab_disabled:
  430. .. rst-class:: classref-method
  431. :ref:`bool<class_bool>` **is_tab_disabled**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_is_tab_disabled>`
  432. Returns ``true`` if the tab at index ``tab_idx`` is disabled.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_TabContainer_method_is_tab_hidden:
  436. .. rst-class:: classref-method
  437. :ref:`bool<class_bool>` **is_tab_hidden**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_TabContainer_method_is_tab_hidden>`
  438. Returns ``true`` if the tab at index ``tab_idx`` is hidden.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_TabContainer_method_select_next_available:
  442. .. rst-class:: classref-method
  443. :ref:`bool<class_bool>` **select_next_available**\ (\ ) :ref:`🔗<class_TabContainer_method_select_next_available>`
  444. Selects the first available tab with greater index than the currently selected. Returns ``true`` if tab selection changed.
  445. .. rst-class:: classref-item-separator
  446. ----
  447. .. _class_TabContainer_method_select_previous_available:
  448. .. rst-class:: classref-method
  449. :ref:`bool<class_bool>` **select_previous_available**\ (\ ) :ref:`🔗<class_TabContainer_method_select_previous_available>`
  450. Selects the first available tab with lower index than the currently selected. Returns ``true`` if tab selection changed.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_TabContainer_method_set_popup:
  454. .. rst-class:: classref-method
  455. |void| **set_popup**\ (\ popup\: :ref:`Node<class_Node>`\ ) :ref:`🔗<class_TabContainer_method_set_popup>`
  456. If set on a :ref:`Popup<class_Popup>` node instance, a popup menu icon appears in the top-right corner of the **TabContainer** (setting it to ``null`` will make it go away). Clicking it will expand the :ref:`Popup<class_Popup>` node.
  457. .. rst-class:: classref-item-separator
  458. ----
  459. .. _class_TabContainer_method_set_tab_button_icon:
  460. .. rst-class:: classref-method
  461. |void| **set_tab_button_icon**\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_button_icon>`
  462. Sets the button icon from the tab at index ``tab_idx``.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_TabContainer_method_set_tab_disabled:
  466. .. rst-class:: classref-method
  467. |void| **set_tab_disabled**\ (\ tab_idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_disabled>`
  468. If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_TabContainer_method_set_tab_hidden:
  472. .. rst-class:: classref-method
  473. |void| **set_tab_hidden**\ (\ tab_idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_hidden>`
  474. If ``hidden`` is ``true``, hides the tab at index ``tab_idx``, making it disappear from the tab area.
  475. .. rst-class:: classref-item-separator
  476. ----
  477. .. _class_TabContainer_method_set_tab_icon:
  478. .. rst-class:: classref-method
  479. |void| **set_tab_icon**\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_icon>`
  480. Sets an icon for the tab at index ``tab_idx``.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_TabContainer_method_set_tab_icon_max_width:
  484. .. rst-class:: classref-method
  485. |void| **set_tab_icon_max_width**\ (\ tab_idx\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_icon_max_width>`
  486. Sets the maximum allowed width of the icon for the tab at index ``tab_idx``. This limit is applied on top of the default size of the icon and on top of :ref:`icon_max_width<class_TabContainer_theme_constant_icon_max_width>`. The height is adjusted according to the icon's ratio.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_TabContainer_method_set_tab_metadata:
  490. .. rst-class:: classref-method
  491. |void| **set_tab_metadata**\ (\ tab_idx\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_metadata>`
  492. Sets the metadata value for the tab at index ``tab_idx``, which can be retrieved later using :ref:`get_tab_metadata()<class_TabContainer_method_get_tab_metadata>`.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_TabContainer_method_set_tab_title:
  496. .. rst-class:: classref-method
  497. |void| **set_tab_title**\ (\ tab_idx\: :ref:`int<class_int>`, title\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_title>`
  498. Sets a custom title for the tab at index ``tab_idx`` (tab titles default to the name of the indexed child node). Set it back to the child's name to make the tab default to it again.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_TabContainer_method_set_tab_tooltip:
  502. .. rst-class:: classref-method
  503. |void| **set_tab_tooltip**\ (\ tab_idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) :ref:`🔗<class_TabContainer_method_set_tab_tooltip>`
  504. Sets a custom tooltip text for tab at index ``tab_idx``.
  505. \ **Note:** By default, if the ``tooltip`` is empty and the tab text is truncated (not all characters fit into the tab), the title will be displayed as a tooltip. To hide the tooltip, assign ``" "`` as the ``tooltip`` text.
  506. .. rst-class:: classref-section-separator
  507. ----
  508. .. rst-class:: classref-descriptions-group
  509. Theme Property Descriptions
  510. ---------------------------
  511. .. _class_TabContainer_theme_color_drop_mark_color:
  512. .. rst-class:: classref-themeproperty
  513. :ref:`Color<class_Color>` **drop_mark_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_TabContainer_theme_color_drop_mark_color>`
  514. Modulation color for the :ref:`drop_mark<class_TabContainer_theme_icon_drop_mark>` icon.
  515. .. rst-class:: classref-item-separator
  516. ----
  517. .. _class_TabContainer_theme_color_font_disabled_color:
  518. .. rst-class:: classref-themeproperty
  519. :ref:`Color<class_Color>` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`🔗<class_TabContainer_theme_color_font_disabled_color>`
  520. Font color of disabled tabs.
  521. .. rst-class:: classref-item-separator
  522. ----
  523. .. _class_TabContainer_theme_color_font_hovered_color:
  524. .. rst-class:: classref-themeproperty
  525. :ref:`Color<class_Color>` **font_hovered_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_TabContainer_theme_color_font_hovered_color>`
  526. Font color of the currently hovered tab.
  527. .. rst-class:: classref-item-separator
  528. ----
  529. .. _class_TabContainer_theme_color_font_outline_color:
  530. .. rst-class:: classref-themeproperty
  531. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`🔗<class_TabContainer_theme_color_font_outline_color>`
  532. The tint of text outline of the tab name.
  533. .. rst-class:: classref-item-separator
  534. ----
  535. .. _class_TabContainer_theme_color_font_selected_color:
  536. .. rst-class:: classref-themeproperty
  537. :ref:`Color<class_Color>` **font_selected_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`🔗<class_TabContainer_theme_color_font_selected_color>`
  538. Font color of the currently selected tab.
  539. .. rst-class:: classref-item-separator
  540. ----
  541. .. _class_TabContainer_theme_color_font_unselected_color:
  542. .. rst-class:: classref-themeproperty
  543. :ref:`Color<class_Color>` **font_unselected_color** = ``Color(0.7, 0.7, 0.7, 1)`` :ref:`🔗<class_TabContainer_theme_color_font_unselected_color>`
  544. Font color of the other, unselected tabs.
  545. .. rst-class:: classref-item-separator
  546. ----
  547. .. _class_TabContainer_theme_constant_icon_max_width:
  548. .. rst-class:: classref-themeproperty
  549. :ref:`int<class_int>` **icon_max_width** = ``0`` :ref:`🔗<class_TabContainer_theme_constant_icon_max_width>`
  550. The maximum allowed width of the tab's icon. This limit is applied on top of the default size of the icon, but before the value set with :ref:`TabBar.set_tab_icon_max_width()<class_TabBar_method_set_tab_icon_max_width>`. The height is adjusted according to the icon's ratio.
  551. .. rst-class:: classref-item-separator
  552. ----
  553. .. _class_TabContainer_theme_constant_icon_separation:
  554. .. rst-class:: classref-themeproperty
  555. :ref:`int<class_int>` **icon_separation** = ``4`` :ref:`🔗<class_TabContainer_theme_constant_icon_separation>`
  556. Space between tab's name and its icon.
  557. .. rst-class:: classref-item-separator
  558. ----
  559. .. _class_TabContainer_theme_constant_outline_size:
  560. .. rst-class:: classref-themeproperty
  561. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`🔗<class_TabContainer_theme_constant_outline_size>`
  562. The size of the tab text outline.
  563. \ **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_TabContainer_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  564. .. rst-class:: classref-item-separator
  565. ----
  566. .. _class_TabContainer_theme_constant_side_margin:
  567. .. rst-class:: classref-themeproperty
  568. :ref:`int<class_int>` **side_margin** = ``8`` :ref:`🔗<class_TabContainer_theme_constant_side_margin>`
  569. The space at the left or right edges of the tab bar, accordingly with the current :ref:`tab_alignment<class_TabContainer_property_tab_alignment>`.
  570. The margin is ignored with :ref:`TabBar.ALIGNMENT_RIGHT<class_TabBar_constant_ALIGNMENT_RIGHT>` if the tabs are clipped (see :ref:`clip_tabs<class_TabContainer_property_clip_tabs>`) or a popup has been set (see :ref:`set_popup()<class_TabContainer_method_set_popup>`). The margin is always ignored with :ref:`TabBar.ALIGNMENT_CENTER<class_TabBar_constant_ALIGNMENT_CENTER>`.
  571. .. rst-class:: classref-item-separator
  572. ----
  573. .. _class_TabContainer_theme_constant_tab_separation:
  574. .. rst-class:: classref-themeproperty
  575. :ref:`int<class_int>` **tab_separation** = ``0`` :ref:`🔗<class_TabContainer_theme_constant_tab_separation>`
  576. The space between tabs in the tab bar.
  577. .. rst-class:: classref-item-separator
  578. ----
  579. .. _class_TabContainer_theme_font_font:
  580. .. rst-class:: classref-themeproperty
  581. :ref:`Font<class_Font>` **font** :ref:`🔗<class_TabContainer_theme_font_font>`
  582. The font used to draw tab names.
  583. .. rst-class:: classref-item-separator
  584. ----
  585. .. _class_TabContainer_theme_font_size_font_size:
  586. .. rst-class:: classref-themeproperty
  587. :ref:`int<class_int>` **font_size** :ref:`🔗<class_TabContainer_theme_font_size_font_size>`
  588. Font size of the tab names.
  589. .. rst-class:: classref-item-separator
  590. ----
  591. .. _class_TabContainer_theme_icon_decrement:
  592. .. rst-class:: classref-themeproperty
  593. :ref:`Texture2D<class_Texture2D>` **decrement** :ref:`🔗<class_TabContainer_theme_icon_decrement>`
  594. Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent.
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_TabContainer_theme_icon_decrement_highlight:
  598. .. rst-class:: classref-themeproperty
  599. :ref:`Texture2D<class_Texture2D>` **decrement_highlight** :ref:`🔗<class_TabContainer_theme_icon_decrement_highlight>`
  600. Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_TabContainer_theme_icon_drop_mark:
  604. .. rst-class:: classref-themeproperty
  605. :ref:`Texture2D<class_Texture2D>` **drop_mark** :ref:`🔗<class_TabContainer_theme_icon_drop_mark>`
  606. Icon shown to indicate where a dragged tab is gonna be dropped (see :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`).
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_TabContainer_theme_icon_increment:
  610. .. rst-class:: classref-themeproperty
  611. :ref:`Texture2D<class_Texture2D>` **increment** :ref:`🔗<class_TabContainer_theme_icon_increment>`
  612. Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent.
  613. .. rst-class:: classref-item-separator
  614. ----
  615. .. _class_TabContainer_theme_icon_increment_highlight:
  616. .. rst-class:: classref-themeproperty
  617. :ref:`Texture2D<class_Texture2D>` **increment_highlight** :ref:`🔗<class_TabContainer_theme_icon_increment_highlight>`
  618. Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor.
  619. .. rst-class:: classref-item-separator
  620. ----
  621. .. _class_TabContainer_theme_icon_menu:
  622. .. rst-class:: classref-themeproperty
  623. :ref:`Texture2D<class_Texture2D>` **menu** :ref:`🔗<class_TabContainer_theme_icon_menu>`
  624. The icon for the menu button (see :ref:`set_popup()<class_TabContainer_method_set_popup>`).
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _class_TabContainer_theme_icon_menu_highlight:
  628. .. rst-class:: classref-themeproperty
  629. :ref:`Texture2D<class_Texture2D>` **menu_highlight** :ref:`🔗<class_TabContainer_theme_icon_menu_highlight>`
  630. The icon for the menu button (see :ref:`set_popup()<class_TabContainer_method_set_popup>`) when it's being hovered with the cursor.
  631. .. rst-class:: classref-item-separator
  632. ----
  633. .. _class_TabContainer_theme_style_panel:
  634. .. rst-class:: classref-themeproperty
  635. :ref:`StyleBox<class_StyleBox>` **panel** :ref:`🔗<class_TabContainer_theme_style_panel>`
  636. The style for the background fill.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _class_TabContainer_theme_style_tab_disabled:
  640. .. rst-class:: classref-themeproperty
  641. :ref:`StyleBox<class_StyleBox>` **tab_disabled** :ref:`🔗<class_TabContainer_theme_style_tab_disabled>`
  642. The style of disabled tabs.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_TabContainer_theme_style_tab_focus:
  646. .. rst-class:: classref-themeproperty
  647. :ref:`StyleBox<class_StyleBox>` **tab_focus** :ref:`🔗<class_TabContainer_theme_style_tab_focus>`
  648. :ref:`StyleBox<class_StyleBox>` used when the :ref:`TabBar<class_TabBar>` is focused. The :ref:`tab_focus<class_TabContainer_theme_style_tab_focus>` :ref:`StyleBox<class_StyleBox>` is displayed *over* the base :ref:`StyleBox<class_StyleBox>` of the selected tab, 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.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_TabContainer_theme_style_tab_hovered:
  652. .. rst-class:: classref-themeproperty
  653. :ref:`StyleBox<class_StyleBox>` **tab_hovered** :ref:`🔗<class_TabContainer_theme_style_tab_hovered>`
  654. The style of the currently hovered tab.
  655. \ **Note:** This style will be drawn with the same width as :ref:`tab_unselected<class_TabContainer_theme_style_tab_unselected>` at minimum.
  656. .. rst-class:: classref-item-separator
  657. ----
  658. .. _class_TabContainer_theme_style_tab_selected:
  659. .. rst-class:: classref-themeproperty
  660. :ref:`StyleBox<class_StyleBox>` **tab_selected** :ref:`🔗<class_TabContainer_theme_style_tab_selected>`
  661. The style of the currently selected tab.
  662. .. rst-class:: classref-item-separator
  663. ----
  664. .. _class_TabContainer_theme_style_tab_unselected:
  665. .. rst-class:: classref-themeproperty
  666. :ref:`StyleBox<class_StyleBox>` **tab_unselected** :ref:`🔗<class_TabContainer_theme_style_tab_unselected>`
  667. The style of the other, unselected tabs.
  668. .. rst-class:: classref-item-separator
  669. ----
  670. .. _class_TabContainer_theme_style_tabbar_background:
  671. .. rst-class:: classref-themeproperty
  672. :ref:`StyleBox<class_StyleBox>` **tabbar_background** :ref:`🔗<class_TabContainer_theme_style_tabbar_background>`
  673. The style for the background fill of the :ref:`TabBar<class_TabBar>` area.
  674. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  675. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  676. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  677. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  678. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  679. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  680. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  681. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  682. .. |void| replace:: :abbr:`void (No return value.)`