class_tabcontainer.rst 60 KB

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