class_tabcontainer.rst 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/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. Tabbed container.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Arranges :ref:`Control<class_Control>` children into a tabbed view, creating a tab for each one. The active tab's corresponding :ref:`Control<class_Control>` has its ``visible`` property set to ``true``, and all other children's to ``false``.
  15. Ignores non-:ref:`Control<class_Control>` children.
  16. \ **Note:** The drawing of the clickable tabs themselves is handled by this node. Adding :ref:`Tabs<class_Tabs>` as children is not needed.
  17. .. rst-class:: classref-introduction-group
  18. Tutorials
  19. ---------
  20. - :doc:`GUI containers <../tutorials/ui/gui_containers>`
  21. .. rst-class:: classref-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`all_tabs_in_front<class_TabContainer_property_all_tabs_in_front>` | ``false`` |
  28. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  29. | :ref:`int<class_int>` | :ref:`current_tab<class_TabContainer_property_current_tab>` | ``0`` |
  30. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  31. | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>` | ``false`` |
  32. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  33. | :ref:`TabAlign<enum_TabContainer_TabAlign>` | :ref:`tab_align<class_TabContainer_property_tab_align>` | ``1`` |
  34. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  35. | :ref:`bool<class_bool>` | :ref:`tabs_visible<class_TabContainer_property_tabs_visible>` | ``true`` |
  36. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  37. | :ref:`bool<class_bool>` | :ref:`use_hidden_tabs_for_min_size<class_TabContainer_property_use_hidden_tabs_for_min_size>` | ``false`` |
  38. +---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
  39. .. rst-class:: classref-reftable-group
  40. Methods
  41. -------
  42. .. table::
  43. :widths: auto
  44. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`Control<class_Control>` | :ref:`get_current_tab_control<class_TabContainer_method_get_current_tab_control>` **(** **)** |const| |
  46. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`Popup<class_Popup>` | :ref:`get_popup<class_TabContainer_method_get_popup>` **(** **)** |const| |
  48. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabContainer_method_get_previous_tab>` **(** **)** |const| |
  50. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`Control<class_Control>` | :ref:`get_tab_control<class_TabContainer_method_get_tab_control>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  52. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`get_tab_count<class_TabContainer_method_get_tab_count>` **(** **)** |const| |
  54. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`get_tab_disabled<class_TabContainer_method_get_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  56. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | :ref:`bool<class_bool>` | :ref:`get_tab_hidden<class_TabContainer_method_get_tab_hidden>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  58. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | :ref:`Texture<class_Texture>` | :ref:`get_tab_icon<class_TabContainer_method_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  60. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`int<class_int>` | :ref:`get_tab_idx_at_point<class_TabContainer_method_get_tab_idx_at_point>` **(** :ref:`Vector2<class_Vector2>` point **)** |const| |
  62. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_String>` | :ref:`get_tab_title<class_TabContainer_method_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
  64. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`int<class_int>` | :ref:`get_tabs_rearrange_group<class_TabContainer_method_get_tabs_rearrange_group>` **(** **)** |const| |
  66. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | void | :ref:`set_popup<class_TabContainer_method_set_popup>` **(** :ref:`Node<class_Node>` popup **)** |
  68. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | void | :ref:`set_tab_disabled<class_TabContainer_method_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
  70. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | void | :ref:`set_tab_hidden<class_TabContainer_method_set_tab_hidden>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` hidden **)** |
  72. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | void | :ref:`set_tab_icon<class_TabContainer_method_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)** |
  74. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | void | :ref:`set_tab_title<class_TabContainer_method_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)** |
  76. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | void | :ref:`set_tabs_rearrange_group<class_TabContainer_method_set_tabs_rearrange_group>` **(** :ref:`int<class_int>` group_id **)** |
  78. +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+
  79. .. rst-class:: classref-reftable-group
  80. Theme Properties
  81. ----------------
  82. .. table::
  83. :widths: auto
  84. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  85. | :ref:`Color<class_Color>` | :ref:`font_color_bg<class_TabContainer_theme_color_font_color_bg>` | ``Color( 0.69, 0.69, 0.69, 1 )`` |
  86. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  87. | :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_TabContainer_theme_color_font_color_disabled>` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` |
  88. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  89. | :ref:`Color<class_Color>` | :ref:`font_color_fg<class_TabContainer_theme_color_font_color_fg>` | ``Color( 0.94, 0.94, 0.94, 1 )`` |
  90. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  91. | :ref:`int<class_int>` | :ref:`hseparation<class_TabContainer_theme_constant_hseparation>` | ``4`` |
  92. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  93. | :ref:`int<class_int>` | :ref:`label_valign_bg<class_TabContainer_theme_constant_label_valign_bg>` | ``2`` |
  94. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  95. | :ref:`int<class_int>` | :ref:`label_valign_fg<class_TabContainer_theme_constant_label_valign_fg>` | ``0`` |
  96. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  97. | :ref:`int<class_int>` | :ref:`side_margin<class_TabContainer_theme_constant_side_margin>` | ``8`` |
  98. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  99. | :ref:`int<class_int>` | :ref:`top_margin<class_TabContainer_theme_constant_top_margin>` | ``24`` |
  100. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  101. | :ref:`Font<class_Font>` | :ref:`font<class_TabContainer_theme_font_font>` | |
  102. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  103. | :ref:`Texture<class_Texture>` | :ref:`decrement<class_TabContainer_theme_icon_decrement>` | |
  104. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  105. | :ref:`Texture<class_Texture>` | :ref:`decrement_highlight<class_TabContainer_theme_icon_decrement_highlight>` | |
  106. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  107. | :ref:`Texture<class_Texture>` | :ref:`increment<class_TabContainer_theme_icon_increment>` | |
  108. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  109. | :ref:`Texture<class_Texture>` | :ref:`increment_highlight<class_TabContainer_theme_icon_increment_highlight>` | |
  110. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  111. | :ref:`Texture<class_Texture>` | :ref:`menu<class_TabContainer_theme_icon_menu>` | |
  112. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  113. | :ref:`Texture<class_Texture>` | :ref:`menu_highlight<class_TabContainer_theme_icon_menu_highlight>` | |
  114. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  115. | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_TabContainer_theme_style_panel>` | |
  116. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  117. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_bg<class_TabContainer_theme_style_tab_bg>` | |
  118. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  119. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_disabled<class_TabContainer_theme_style_tab_disabled>` | |
  120. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  121. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_fg<class_TabContainer_theme_style_tab_fg>` | |
  122. +---------------------------------+--------------------------------------------------------------------------------+----------------------------------+
  123. .. rst-class:: classref-section-separator
  124. ----
  125. .. rst-class:: classref-descriptions-group
  126. Signals
  127. -------
  128. .. _class_TabContainer_signal_pre_popup_pressed:
  129. .. rst-class:: classref-signal
  130. **pre_popup_pressed** **(** **)**
  131. Emitted when the **TabContainer**'s :ref:`Popup<class_Popup>` button is clicked. See :ref:`set_popup<class_TabContainer_method_set_popup>` for details.
  132. .. rst-class:: classref-item-separator
  133. ----
  134. .. _class_TabContainer_signal_tab_changed:
  135. .. rst-class:: classref-signal
  136. **tab_changed** **(** :ref:`int<class_int>` tab **)**
  137. Emitted when switching to another tab.
  138. .. rst-class:: classref-item-separator
  139. ----
  140. .. _class_TabContainer_signal_tab_selected:
  141. .. rst-class:: classref-signal
  142. **tab_selected** **(** :ref:`int<class_int>` tab **)**
  143. Emitted when a tab is selected, even if it is the current tab.
  144. .. rst-class:: classref-section-separator
  145. ----
  146. .. rst-class:: classref-descriptions-group
  147. Enumerations
  148. ------------
  149. .. _enum_TabContainer_TabAlign:
  150. .. rst-class:: classref-enumeration
  151. enum **TabAlign**:
  152. .. _class_TabContainer_constant_ALIGN_LEFT:
  153. .. rst-class:: classref-enumeration-constant
  154. :ref:`TabAlign<enum_TabContainer_TabAlign>` **ALIGN_LEFT** = ``0``
  155. Align the tabs to the left.
  156. .. _class_TabContainer_constant_ALIGN_CENTER:
  157. .. rst-class:: classref-enumeration-constant
  158. :ref:`TabAlign<enum_TabContainer_TabAlign>` **ALIGN_CENTER** = ``1``
  159. Align the tabs to the center.
  160. .. _class_TabContainer_constant_ALIGN_RIGHT:
  161. .. rst-class:: classref-enumeration-constant
  162. :ref:`TabAlign<enum_TabContainer_TabAlign>` **ALIGN_RIGHT** = ``2``
  163. Align the tabs to the right.
  164. .. rst-class:: classref-section-separator
  165. ----
  166. .. rst-class:: classref-descriptions-group
  167. Property Descriptions
  168. ---------------------
  169. .. _class_TabContainer_property_all_tabs_in_front:
  170. .. rst-class:: classref-property
  171. :ref:`bool<class_bool>` **all_tabs_in_front** = ``false``
  172. .. rst-class:: classref-property-setget
  173. - void **set_all_tabs_in_front** **(** :ref:`bool<class_bool>` value **)**
  174. - :ref:`bool<class_bool>` **is_all_tabs_in_front** **(** **)**
  175. If ``true``, all tabs are drawn in front of the panel. If ``false``, inactive tabs are drawn behind the panel.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_TabContainer_property_current_tab:
  179. .. rst-class:: classref-property
  180. :ref:`int<class_int>` **current_tab** = ``0``
  181. .. rst-class:: classref-property-setget
  182. - void **set_current_tab** **(** :ref:`int<class_int>` value **)**
  183. - :ref:`int<class_int>` **get_current_tab** **(** **)**
  184. 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``.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_TabContainer_property_drag_to_rearrange_enabled:
  188. .. rst-class:: classref-property
  189. :ref:`bool<class_bool>` **drag_to_rearrange_enabled** = ``false``
  190. .. rst-class:: classref-property-setget
  191. - void **set_drag_to_rearrange_enabled** **(** :ref:`bool<class_bool>` value **)**
  192. - :ref:`bool<class_bool>` **get_drag_to_rearrange_enabled** **(** **)**
  193. If ``true``, tabs can be rearranged with mouse drag.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_TabContainer_property_tab_align:
  197. .. rst-class:: classref-property
  198. :ref:`TabAlign<enum_TabContainer_TabAlign>` **tab_align** = ``1``
  199. .. rst-class:: classref-property-setget
  200. - void **set_tab_align** **(** :ref:`TabAlign<enum_TabContainer_TabAlign>` value **)**
  201. - :ref:`TabAlign<enum_TabContainer_TabAlign>` **get_tab_align** **(** **)**
  202. The alignment of all tabs in the tab container. See the :ref:`TabAlign<enum_TabContainer_TabAlign>` constants for details.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_TabContainer_property_tabs_visible:
  206. .. rst-class:: classref-property
  207. :ref:`bool<class_bool>` **tabs_visible** = ``true``
  208. .. rst-class:: classref-property-setget
  209. - void **set_tabs_visible** **(** :ref:`bool<class_bool>` value **)**
  210. - :ref:`bool<class_bool>` **are_tabs_visible** **(** **)**
  211. If ``true``, tabs are visible. If ``false``, tabs' content and titles are hidden.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_TabContainer_property_use_hidden_tabs_for_min_size:
  215. .. rst-class:: classref-property
  216. :ref:`bool<class_bool>` **use_hidden_tabs_for_min_size** = ``false``
  217. .. rst-class:: classref-property-setget
  218. - void **set_use_hidden_tabs_for_min_size** **(** :ref:`bool<class_bool>` value **)**
  219. - :ref:`bool<class_bool>` **get_use_hidden_tabs_for_min_size** **(** **)**
  220. If ``true``, children :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.
  221. .. rst-class:: classref-section-separator
  222. ----
  223. .. rst-class:: classref-descriptions-group
  224. Method Descriptions
  225. -------------------
  226. .. _class_TabContainer_method_get_current_tab_control:
  227. .. rst-class:: classref-method
  228. :ref:`Control<class_Control>` **get_current_tab_control** **(** **)** |const|
  229. Returns the child :ref:`Control<class_Control>` node located at the active tab index.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_TabContainer_method_get_popup:
  233. .. rst-class:: classref-method
  234. :ref:`Popup<class_Popup>` **get_popup** **(** **)** |const|
  235. Returns the :ref:`Popup<class_Popup>` node instance if one has been set already with :ref:`set_popup<class_TabContainer_method_set_popup>`.
  236. \ **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:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_TabContainer_method_get_previous_tab:
  240. .. rst-class:: classref-method
  241. :ref:`int<class_int>` **get_previous_tab** **(** **)** |const|
  242. Returns the previously active tab index.
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_TabContainer_method_get_tab_control:
  246. .. rst-class:: classref-method
  247. :ref:`Control<class_Control>` **get_tab_control** **(** :ref:`int<class_int>` tab_idx **)** |const|
  248. Returns the :ref:`Control<class_Control>` node from the tab at index ``tab_idx``.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_TabContainer_method_get_tab_count:
  252. .. rst-class:: classref-method
  253. :ref:`int<class_int>` **get_tab_count** **(** **)** |const|
  254. Returns the number of tabs.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_TabContainer_method_get_tab_disabled:
  258. .. rst-class:: classref-method
  259. :ref:`bool<class_bool>` **get_tab_disabled** **(** :ref:`int<class_int>` tab_idx **)** |const|
  260. Returns ``true`` if the tab at index ``tab_idx`` is disabled.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_TabContainer_method_get_tab_hidden:
  264. .. rst-class:: classref-method
  265. :ref:`bool<class_bool>` **get_tab_hidden** **(** :ref:`int<class_int>` tab_idx **)** |const|
  266. Returns ``true`` if the tab at index ``tab_idx`` is hidden.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_TabContainer_method_get_tab_icon:
  270. .. rst-class:: classref-method
  271. :ref:`Texture<class_Texture>` **get_tab_icon** **(** :ref:`int<class_int>` tab_idx **)** |const|
  272. Returns the :ref:`Texture<class_Texture>` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture<class_Texture>`.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_TabContainer_method_get_tab_idx_at_point:
  276. .. rst-class:: classref-method
  277. :ref:`int<class_int>` **get_tab_idx_at_point** **(** :ref:`Vector2<class_Vector2>` point **)** |const|
  278. 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.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_TabContainer_method_get_tab_title:
  282. .. rst-class:: classref-method
  283. :ref:`String<class_String>` **get_tab_title** **(** :ref:`int<class_int>` tab_idx **)** |const|
  284. 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>`.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_TabContainer_method_get_tabs_rearrange_group:
  288. .. rst-class:: classref-method
  289. :ref:`int<class_int>` **get_tabs_rearrange_group** **(** **)** |const|
  290. Returns the **TabContainer** rearrange group id.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_TabContainer_method_set_popup:
  294. .. rst-class:: classref-method
  295. void **set_popup** **(** :ref:`Node<class_Node>` popup **)**
  296. If set on a :ref:`Popup<class_Popup>` node instance, a popup menu icon appears in the top-right corner of the **TabContainer**. Clicking it will expand the :ref:`Popup<class_Popup>` node.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_TabContainer_method_set_tab_disabled:
  300. .. rst-class:: classref-method
  301. void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)**
  302. If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_TabContainer_method_set_tab_hidden:
  306. .. rst-class:: classref-method
  307. void **set_tab_hidden** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` hidden **)**
  308. If ``hidden`` is ``true``, hides the tab at index ``tab_idx``, making it disappear from the tab area.
  309. .. rst-class:: classref-item-separator
  310. ----
  311. .. _class_TabContainer_method_set_tab_icon:
  312. .. rst-class:: classref-method
  313. void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture<class_Texture>` icon **)**
  314. Sets an icon for the tab at index ``tab_idx``.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_TabContainer_method_set_tab_title:
  318. .. rst-class:: classref-method
  319. void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)**
  320. Sets a title for the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_TabContainer_method_set_tabs_rearrange_group:
  324. .. rst-class:: classref-method
  325. void **set_tabs_rearrange_group** **(** :ref:`int<class_int>` group_id **)**
  326. Defines rearrange group id, choose for each **TabContainer** the same value to enable tab drag between **TabContainer**. Enable drag with :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`.
  327. .. rst-class:: classref-section-separator
  328. ----
  329. .. rst-class:: classref-descriptions-group
  330. Theme Property Descriptions
  331. ---------------------------
  332. .. _class_TabContainer_theme_color_font_color_bg:
  333. .. rst-class:: classref-themeproperty
  334. :ref:`Color<class_Color>` **font_color_bg** = ``Color( 0.69, 0.69, 0.69, 1 )``
  335. Font color of inactive tabs.
  336. .. rst-class:: classref-item-separator
  337. ----
  338. .. _class_TabContainer_theme_color_font_color_disabled:
  339. .. rst-class:: classref-themeproperty
  340. :ref:`Color<class_Color>` **font_color_disabled** = ``Color( 0.9, 0.9, 0.9, 0.2 )``
  341. Font color of disabled tabs.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_TabContainer_theme_color_font_color_fg:
  345. .. rst-class:: classref-themeproperty
  346. :ref:`Color<class_Color>` **font_color_fg** = ``Color( 0.94, 0.94, 0.94, 1 )``
  347. Font color of the currently selected tab.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_TabContainer_theme_constant_hseparation:
  351. .. rst-class:: classref-themeproperty
  352. :ref:`int<class_int>` **hseparation** = ``4``
  353. Horizontal separation between tabs.
  354. .. rst-class:: classref-item-separator
  355. ----
  356. .. _class_TabContainer_theme_constant_label_valign_bg:
  357. .. rst-class:: classref-themeproperty
  358. :ref:`int<class_int>` **label_valign_bg** = ``2``
  359. .. container:: contribute
  360. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  361. .. rst-class:: classref-item-separator
  362. ----
  363. .. _class_TabContainer_theme_constant_label_valign_fg:
  364. .. rst-class:: classref-themeproperty
  365. :ref:`int<class_int>` **label_valign_fg** = ``0``
  366. .. container:: contribute
  367. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  368. .. rst-class:: classref-item-separator
  369. ----
  370. .. _class_TabContainer_theme_constant_side_margin:
  371. .. rst-class:: classref-themeproperty
  372. :ref:`int<class_int>` **side_margin** = ``8``
  373. The space at the left and right edges of the tab bar.
  374. .. rst-class:: classref-item-separator
  375. ----
  376. .. _class_TabContainer_theme_constant_top_margin:
  377. .. rst-class:: classref-themeproperty
  378. :ref:`int<class_int>` **top_margin** = ``24``
  379. .. container:: contribute
  380. There is currently no description for this theme property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  381. .. rst-class:: classref-item-separator
  382. ----
  383. .. _class_TabContainer_theme_font_font:
  384. .. rst-class:: classref-themeproperty
  385. :ref:`Font<class_Font>` **font**
  386. The font used to draw tab names.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_TabContainer_theme_icon_decrement:
  390. .. rst-class:: classref-themeproperty
  391. :ref:`Texture<class_Texture>` **decrement**
  392. 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.
  393. .. rst-class:: classref-item-separator
  394. ----
  395. .. _class_TabContainer_theme_icon_decrement_highlight:
  396. .. rst-class:: classref-themeproperty
  397. :ref:`Texture<class_Texture>` **decrement_highlight**
  398. 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.
  399. .. rst-class:: classref-item-separator
  400. ----
  401. .. _class_TabContainer_theme_icon_increment:
  402. .. rst-class:: classref-themeproperty
  403. :ref:`Texture<class_Texture>` **increment**
  404. 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.
  405. .. rst-class:: classref-item-separator
  406. ----
  407. .. _class_TabContainer_theme_icon_increment_highlight:
  408. .. rst-class:: classref-themeproperty
  409. :ref:`Texture<class_Texture>` **increment_highlight**
  410. 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.
  411. .. rst-class:: classref-item-separator
  412. ----
  413. .. _class_TabContainer_theme_icon_menu:
  414. .. rst-class:: classref-themeproperty
  415. :ref:`Texture<class_Texture>` **menu**
  416. The icon for the menu button (see :ref:`set_popup<class_TabContainer_method_set_popup>`).
  417. .. rst-class:: classref-item-separator
  418. ----
  419. .. _class_TabContainer_theme_icon_menu_highlight:
  420. .. rst-class:: classref-themeproperty
  421. :ref:`Texture<class_Texture>` **menu_highlight**
  422. The icon for the menu button (see :ref:`set_popup<class_TabContainer_method_set_popup>`) when it's being hovered with the cursor.
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_TabContainer_theme_style_panel:
  426. .. rst-class:: classref-themeproperty
  427. :ref:`StyleBox<class_StyleBox>` **panel**
  428. The style for the background fill.
  429. .. rst-class:: classref-item-separator
  430. ----
  431. .. _class_TabContainer_theme_style_tab_bg:
  432. .. rst-class:: classref-themeproperty
  433. :ref:`StyleBox<class_StyleBox>` **tab_bg**
  434. The style of inactive tabs.
  435. .. rst-class:: classref-item-separator
  436. ----
  437. .. _class_TabContainer_theme_style_tab_disabled:
  438. .. rst-class:: classref-themeproperty
  439. :ref:`StyleBox<class_StyleBox>` **tab_disabled**
  440. The style of disabled tabs.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_TabContainer_theme_style_tab_fg:
  444. .. rst-class:: classref-themeproperty
  445. :ref:`StyleBox<class_StyleBox>` **tab_fg**
  446. The style of the currently selected tab.
  447. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  448. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  449. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  450. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`