class_tabbar.rst 66 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393
  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/TabBar.xml.
  6. .. _class_TabBar:
  7. TabBar
  8. ======
  9. **Inherits:** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A control that provides a horizontal bar with tabs.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A control that provides a horizontal bar with tabs. Similar to :ref:`TabContainer<class_TabContainer>` but is only in charge of drawing tabs, not interacting with children.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`clip_tabs<class_TabBar_property_clip_tabs>` | ``true`` |
  22. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`close_with_middle_mouse<class_TabBar_property_close_with_middle_mouse>` | ``true`` |
  24. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  25. | :ref:`int<class_int>` | :ref:`current_tab<class_TabBar_property_current_tab>` | ``-1`` |
  26. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`deselect_enabled<class_TabBar_property_deselect_enabled>` | ``false`` |
  28. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_TabBar_property_drag_to_rearrange_enabled>` | ``false`` |
  30. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  31. | :ref:`FocusMode<enum_Control_FocusMode>` | focus_mode | ``2`` (overrides :ref:`Control<class_Control_property_focus_mode>`) |
  32. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  33. | :ref:`int<class_int>` | :ref:`max_tab_width<class_TabBar_property_max_tab_width>` | ``0`` |
  34. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`scroll_to_selected<class_TabBar_property_scroll_to_selected>` | ``true`` |
  36. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`scrolling_enabled<class_TabBar_property_scrolling_enabled>` | ``true`` |
  38. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`select_with_rmb<class_TabBar_property_select_with_rmb>` | ``false`` |
  40. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  41. | :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` | :ref:`tab_alignment<class_TabBar_property_tab_alignment>` | ``0`` |
  42. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  43. | :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` | :ref:`tab_close_display_policy<class_TabBar_property_tab_close_display_policy>` | ``0`` |
  44. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  45. | :ref:`int<class_int>` | :ref:`tab_count<class_TabBar_property_tab_count>` | ``0`` |
  46. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  47. | :ref:`int<class_int>` | :ref:`tabs_rearrange_group<class_TabBar_property_tabs_rearrange_group>` | ``-1`` |
  48. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+---------------------------------------------------------------------+
  49. .. rst-class:: classref-reftable-group
  50. Methods
  51. -------
  52. .. table::
  53. :widths: auto
  54. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  55. | |void| | :ref:`add_tab<class_TabBar_method_add_tab>`\ (\ title\: :ref:`String<class_String>` = "", icon\: :ref:`Texture2D<class_Texture2D>` = null\ ) |
  56. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  57. | |void| | :ref:`clear_tabs<class_TabBar_method_clear_tabs>`\ (\ ) |
  58. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  59. | |void| | :ref:`ensure_tab_visible<class_TabBar_method_ensure_tab_visible>`\ (\ idx\: :ref:`int<class_int>`\ ) |
  60. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  61. | :ref:`bool<class_bool>` | :ref:`get_offset_buttons_visible<class_TabBar_method_get_offset_buttons_visible>`\ (\ ) |const| |
  62. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  63. | :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabBar_method_get_previous_tab>`\ (\ ) |const| |
  64. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  65. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_tab_button_icon<class_TabBar_method_get_tab_button_icon>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  66. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  67. | :ref:`Texture2D<class_Texture2D>` | :ref:`get_tab_icon<class_TabBar_method_get_tab_icon>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  68. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  69. | :ref:`int<class_int>` | :ref:`get_tab_icon_max_width<class_TabBar_method_get_tab_icon_max_width>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  70. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  71. | :ref:`int<class_int>` | :ref:`get_tab_idx_at_point<class_TabBar_method_get_tab_idx_at_point>`\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |const| |
  72. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | :ref:`String<class_String>` | :ref:`get_tab_language<class_TabBar_method_get_tab_language>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  74. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | :ref:`Variant<class_Variant>` | :ref:`get_tab_metadata<class_TabBar_method_get_tab_metadata>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  76. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | :ref:`int<class_int>` | :ref:`get_tab_offset<class_TabBar_method_get_tab_offset>`\ (\ ) |const| |
  78. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | :ref:`Rect2<class_Rect2>` | :ref:`get_tab_rect<class_TabBar_method_get_tab_rect>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  80. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | :ref:`TextDirection<enum_Control_TextDirection>` | :ref:`get_tab_text_direction<class_TabBar_method_get_tab_text_direction>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  82. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`String<class_String>` | :ref:`get_tab_title<class_TabBar_method_get_tab_title>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  84. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`String<class_String>` | :ref:`get_tab_tooltip<class_TabBar_method_get_tab_tooltip>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  86. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`bool<class_bool>` | :ref:`is_tab_disabled<class_TabBar_method_is_tab_disabled>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  88. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`bool<class_bool>` | :ref:`is_tab_hidden<class_TabBar_method_is_tab_hidden>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| |
  90. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | |void| | :ref:`move_tab<class_TabBar_method_move_tab>`\ (\ from\: :ref:`int<class_int>`, to\: :ref:`int<class_int>`\ ) |
  92. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | |void| | :ref:`remove_tab<class_TabBar_method_remove_tab>`\ (\ tab_idx\: :ref:`int<class_int>`\ ) |
  94. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | :ref:`bool<class_bool>` | :ref:`select_next_available<class_TabBar_method_select_next_available>`\ (\ ) |
  96. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`bool<class_bool>` | :ref:`select_previous_available<class_TabBar_method_select_previous_available>`\ (\ ) |
  98. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`set_tab_button_icon<class_TabBar_method_set_tab_button_icon>`\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
  100. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | |void| | :ref:`set_tab_disabled<class_TabBar_method_set_tab_disabled>`\ (\ tab_idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) |
  102. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | |void| | :ref:`set_tab_hidden<class_TabBar_method_set_tab_hidden>`\ (\ tab_idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ ) |
  104. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | |void| | :ref:`set_tab_icon<class_TabBar_method_set_tab_icon>`\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) |
  106. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. | |void| | :ref:`set_tab_icon_max_width<class_TabBar_method_set_tab_icon_max_width>`\ (\ tab_idx\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) |
  108. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  109. | |void| | :ref:`set_tab_language<class_TabBar_method_set_tab_language>`\ (\ tab_idx\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) |
  110. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  111. | |void| | :ref:`set_tab_metadata<class_TabBar_method_set_tab_metadata>`\ (\ tab_idx\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) |
  112. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  113. | |void| | :ref:`set_tab_text_direction<class_TabBar_method_set_tab_text_direction>`\ (\ tab_idx\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) |
  114. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  115. | |void| | :ref:`set_tab_title<class_TabBar_method_set_tab_title>`\ (\ tab_idx\: :ref:`int<class_int>`, title\: :ref:`String<class_String>`\ ) |
  116. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  117. | |void| | :ref:`set_tab_tooltip<class_TabBar_method_set_tab_tooltip>`\ (\ tab_idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) |
  118. +--------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  119. .. rst-class:: classref-reftable-group
  120. Theme Properties
  121. ----------------
  122. .. table::
  123. :widths: auto
  124. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  125. | :ref:`Color<class_Color>` | :ref:`drop_mark_color<class_TabBar_theme_color_drop_mark_color>` | ``Color(1, 1, 1, 1)`` |
  126. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  127. | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_TabBar_theme_color_font_disabled_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
  128. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  129. | :ref:`Color<class_Color>` | :ref:`font_hovered_color<class_TabBar_theme_color_font_hovered_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  130. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  131. | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TabBar_theme_color_font_outline_color>` | ``Color(0, 0, 0, 1)`` |
  132. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  133. | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TabBar_theme_color_font_selected_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
  134. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  135. | :ref:`Color<class_Color>` | :ref:`font_unselected_color<class_TabBar_theme_color_font_unselected_color>` | ``Color(0.7, 0.7, 0.7, 1)`` |
  136. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  137. | :ref:`Color<class_Color>` | :ref:`icon_disabled_color<class_TabBar_theme_color_icon_disabled_color>` | ``Color(1, 1, 1, 1)`` |
  138. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  139. | :ref:`Color<class_Color>` | :ref:`icon_hovered_color<class_TabBar_theme_color_icon_hovered_color>` | ``Color(1, 1, 1, 1)`` |
  140. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  141. | :ref:`Color<class_Color>` | :ref:`icon_selected_color<class_TabBar_theme_color_icon_selected_color>` | ``Color(1, 1, 1, 1)`` |
  142. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  143. | :ref:`Color<class_Color>` | :ref:`icon_unselected_color<class_TabBar_theme_color_icon_unselected_color>` | ``Color(1, 1, 1, 1)`` |
  144. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  145. | :ref:`int<class_int>` | :ref:`h_separation<class_TabBar_theme_constant_h_separation>` | ``4`` |
  146. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  147. | :ref:`int<class_int>` | :ref:`icon_max_width<class_TabBar_theme_constant_icon_max_width>` | ``0`` |
  148. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  149. | :ref:`int<class_int>` | :ref:`outline_size<class_TabBar_theme_constant_outline_size>` | ``0`` |
  150. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  151. | :ref:`int<class_int>` | :ref:`tab_separation<class_TabBar_theme_constant_tab_separation>` | ``0`` |
  152. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  153. | :ref:`Font<class_Font>` | :ref:`font<class_TabBar_theme_font_font>` | |
  154. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  155. | :ref:`int<class_int>` | :ref:`font_size<class_TabBar_theme_font_size_font_size>` | |
  156. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  157. | :ref:`Texture2D<class_Texture2D>` | :ref:`close<class_TabBar_theme_icon_close>` | |
  158. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  159. | :ref:`Texture2D<class_Texture2D>` | :ref:`decrement<class_TabBar_theme_icon_decrement>` | |
  160. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  161. | :ref:`Texture2D<class_Texture2D>` | :ref:`decrement_highlight<class_TabBar_theme_icon_decrement_highlight>` | |
  162. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  163. | :ref:`Texture2D<class_Texture2D>` | :ref:`drop_mark<class_TabBar_theme_icon_drop_mark>` | |
  164. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  165. | :ref:`Texture2D<class_Texture2D>` | :ref:`increment<class_TabBar_theme_icon_increment>` | |
  166. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  167. | :ref:`Texture2D<class_Texture2D>` | :ref:`increment_highlight<class_TabBar_theme_icon_increment_highlight>` | |
  168. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  169. | :ref:`StyleBox<class_StyleBox>` | :ref:`button_highlight<class_TabBar_theme_style_button_highlight>` | |
  170. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  171. | :ref:`StyleBox<class_StyleBox>` | :ref:`button_pressed<class_TabBar_theme_style_button_pressed>` | |
  172. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  173. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_disabled<class_TabBar_theme_style_tab_disabled>` | |
  174. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  175. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_focus<class_TabBar_theme_style_tab_focus>` | |
  176. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  177. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_hovered<class_TabBar_theme_style_tab_hovered>` | |
  178. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  179. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_selected<class_TabBar_theme_style_tab_selected>` | |
  180. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  181. | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_unselected<class_TabBar_theme_style_tab_unselected>` | |
  182. +-----------------------------------+------------------------------------------------------------------------------+-------------------------------------+
  183. .. rst-class:: classref-section-separator
  184. ----
  185. .. rst-class:: classref-descriptions-group
  186. Signals
  187. -------
  188. .. _class_TabBar_signal_active_tab_rearranged:
  189. .. rst-class:: classref-signal
  190. **active_tab_rearranged**\ (\ idx_to\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_active_tab_rearranged>`
  191. Emitted when the active tab is rearranged via mouse drag. See :ref:`drag_to_rearrange_enabled<class_TabBar_property_drag_to_rearrange_enabled>`.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_TabBar_signal_tab_button_pressed:
  195. .. rst-class:: classref-signal
  196. **tab_button_pressed**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_button_pressed>`
  197. Emitted when a tab's right button is pressed. See :ref:`set_tab_button_icon()<class_TabBar_method_set_tab_button_icon>`.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_TabBar_signal_tab_changed:
  201. .. rst-class:: classref-signal
  202. **tab_changed**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_changed>`
  203. Emitted when switching to another tab.
  204. .. rst-class:: classref-item-separator
  205. ----
  206. .. _class_TabBar_signal_tab_clicked:
  207. .. rst-class:: classref-signal
  208. **tab_clicked**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_clicked>`
  209. Emitted when a tab is clicked, even if it is the current tab.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_TabBar_signal_tab_close_pressed:
  213. .. rst-class:: classref-signal
  214. **tab_close_pressed**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_close_pressed>`
  215. Emitted when a tab's close button is pressed or when middle-clicking on a tab, if :ref:`close_with_middle_mouse<class_TabBar_property_close_with_middle_mouse>` is enabled.
  216. \ **Note:** Tabs are not removed automatically once the close button is pressed, this behavior needs to be programmed manually. For example:
  217. .. tabs::
  218. .. code-tab:: gdscript
  219. $TabBar.tab_close_pressed.connect($TabBar.remove_tab)
  220. .. code-tab:: csharp
  221. GetNode<TabBar>("TabBar").TabClosePressed += GetNode<TabBar>("TabBar").RemoveTab;
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_TabBar_signal_tab_hovered:
  225. .. rst-class:: classref-signal
  226. **tab_hovered**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_hovered>`
  227. Emitted when a tab is hovered by the mouse.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_TabBar_signal_tab_rmb_clicked:
  231. .. rst-class:: classref-signal
  232. **tab_rmb_clicked**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_rmb_clicked>`
  233. Emitted when a tab is right-clicked. :ref:`select_with_rmb<class_TabBar_property_select_with_rmb>` must be enabled.
  234. .. rst-class:: classref-item-separator
  235. ----
  236. .. _class_TabBar_signal_tab_selected:
  237. .. rst-class:: classref-signal
  238. **tab_selected**\ (\ tab\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_signal_tab_selected>`
  239. Emitted when a tab is selected via click, directional input, or script, even if it is the current tab.
  240. .. rst-class:: classref-section-separator
  241. ----
  242. .. rst-class:: classref-descriptions-group
  243. Enumerations
  244. ------------
  245. .. _enum_TabBar_AlignmentMode:
  246. .. rst-class:: classref-enumeration
  247. enum **AlignmentMode**: :ref:`๐Ÿ”—<enum_TabBar_AlignmentMode>`
  248. .. _class_TabBar_constant_ALIGNMENT_LEFT:
  249. .. rst-class:: classref-enumeration-constant
  250. :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **ALIGNMENT_LEFT** = ``0``
  251. Places tabs to the left.
  252. .. _class_TabBar_constant_ALIGNMENT_CENTER:
  253. .. rst-class:: classref-enumeration-constant
  254. :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **ALIGNMENT_CENTER** = ``1``
  255. Places tabs in the middle.
  256. .. _class_TabBar_constant_ALIGNMENT_RIGHT:
  257. .. rst-class:: classref-enumeration-constant
  258. :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **ALIGNMENT_RIGHT** = ``2``
  259. Places tabs to the right.
  260. .. _class_TabBar_constant_ALIGNMENT_MAX:
  261. .. rst-class:: classref-enumeration-constant
  262. :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **ALIGNMENT_MAX** = ``3``
  263. Represents the size of the :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` enum.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _enum_TabBar_CloseButtonDisplayPolicy:
  267. .. rst-class:: classref-enumeration
  268. enum **CloseButtonDisplayPolicy**: :ref:`๐Ÿ”—<enum_TabBar_CloseButtonDisplayPolicy>`
  269. .. _class_TabBar_constant_CLOSE_BUTTON_SHOW_NEVER:
  270. .. rst-class:: classref-enumeration-constant
  271. :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_SHOW_NEVER** = ``0``
  272. Never show the close buttons.
  273. .. _class_TabBar_constant_CLOSE_BUTTON_SHOW_ACTIVE_ONLY:
  274. .. rst-class:: classref-enumeration-constant
  275. :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_SHOW_ACTIVE_ONLY** = ``1``
  276. Only show the close button on the currently active tab.
  277. .. _class_TabBar_constant_CLOSE_BUTTON_SHOW_ALWAYS:
  278. .. rst-class:: classref-enumeration-constant
  279. :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_SHOW_ALWAYS** = ``2``
  280. Show the close button on all tabs.
  281. .. _class_TabBar_constant_CLOSE_BUTTON_MAX:
  282. .. rst-class:: classref-enumeration-constant
  283. :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` **CLOSE_BUTTON_MAX** = ``3``
  284. Represents the size of the :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` enum.
  285. .. rst-class:: classref-section-separator
  286. ----
  287. .. rst-class:: classref-descriptions-group
  288. Property Descriptions
  289. ---------------------
  290. .. _class_TabBar_property_clip_tabs:
  291. .. rst-class:: classref-property
  292. :ref:`bool<class_bool>` **clip_tabs** = ``true`` :ref:`๐Ÿ”—<class_TabBar_property_clip_tabs>`
  293. .. rst-class:: classref-property-setget
  294. - |void| **set_clip_tabs**\ (\ value\: :ref:`bool<class_bool>`\ )
  295. - :ref:`bool<class_bool>` **get_clip_tabs**\ (\ )
  296. 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.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_TabBar_property_close_with_middle_mouse:
  300. .. rst-class:: classref-property
  301. :ref:`bool<class_bool>` **close_with_middle_mouse** = ``true`` :ref:`๐Ÿ”—<class_TabBar_property_close_with_middle_mouse>`
  302. .. rst-class:: classref-property-setget
  303. - |void| **set_close_with_middle_mouse**\ (\ value\: :ref:`bool<class_bool>`\ )
  304. - :ref:`bool<class_bool>` **get_close_with_middle_mouse**\ (\ )
  305. If ``true``, middle clicking on the mouse will fire the :ref:`tab_close_pressed<class_TabBar_signal_tab_close_pressed>` signal.
  306. .. rst-class:: classref-item-separator
  307. ----
  308. .. _class_TabBar_property_current_tab:
  309. .. rst-class:: classref-property
  310. :ref:`int<class_int>` **current_tab** = ``-1`` :ref:`๐Ÿ”—<class_TabBar_property_current_tab>`
  311. .. rst-class:: classref-property-setget
  312. - |void| **set_current_tab**\ (\ value\: :ref:`int<class_int>`\ )
  313. - :ref:`int<class_int>` **get_current_tab**\ (\ )
  314. The index of the current selected tab. A value of ``-1`` means that no tab is selected and can only be set when :ref:`deselect_enabled<class_TabBar_property_deselect_enabled>` is ``true`` or if all tabs are hidden or disabled.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_TabBar_property_deselect_enabled:
  318. .. rst-class:: classref-property
  319. :ref:`bool<class_bool>` **deselect_enabled** = ``false`` :ref:`๐Ÿ”—<class_TabBar_property_deselect_enabled>`
  320. .. rst-class:: classref-property-setget
  321. - |void| **set_deselect_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  322. - :ref:`bool<class_bool>` **get_deselect_enabled**\ (\ )
  323. If ``true``, all tabs can be deselected so that no tab is selected. Click on the current tab to deselect it.
  324. .. rst-class:: classref-item-separator
  325. ----
  326. .. _class_TabBar_property_drag_to_rearrange_enabled:
  327. .. rst-class:: classref-property
  328. :ref:`bool<class_bool>` **drag_to_rearrange_enabled** = ``false`` :ref:`๐Ÿ”—<class_TabBar_property_drag_to_rearrange_enabled>`
  329. .. rst-class:: classref-property-setget
  330. - |void| **set_drag_to_rearrange_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  331. - :ref:`bool<class_bool>` **get_drag_to_rearrange_enabled**\ (\ )
  332. If ``true``, tabs can be rearranged with mouse drag.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_TabBar_property_max_tab_width:
  336. .. rst-class:: classref-property
  337. :ref:`int<class_int>` **max_tab_width** = ``0`` :ref:`๐Ÿ”—<class_TabBar_property_max_tab_width>`
  338. .. rst-class:: classref-property-setget
  339. - |void| **set_max_tab_width**\ (\ value\: :ref:`int<class_int>`\ )
  340. - :ref:`int<class_int>` **get_max_tab_width**\ (\ )
  341. Sets the maximum width which all tabs should be limited to. Unlimited if set to ``0``.
  342. .. rst-class:: classref-item-separator
  343. ----
  344. .. _class_TabBar_property_scroll_to_selected:
  345. .. rst-class:: classref-property
  346. :ref:`bool<class_bool>` **scroll_to_selected** = ``true`` :ref:`๐Ÿ”—<class_TabBar_property_scroll_to_selected>`
  347. .. rst-class:: classref-property-setget
  348. - |void| **set_scroll_to_selected**\ (\ value\: :ref:`bool<class_bool>`\ )
  349. - :ref:`bool<class_bool>` **get_scroll_to_selected**\ (\ )
  350. If ``true``, the tab offset will be changed to keep the currently selected tab visible.
  351. .. rst-class:: classref-item-separator
  352. ----
  353. .. _class_TabBar_property_scrolling_enabled:
  354. .. rst-class:: classref-property
  355. :ref:`bool<class_bool>` **scrolling_enabled** = ``true`` :ref:`๐Ÿ”—<class_TabBar_property_scrolling_enabled>`
  356. .. rst-class:: classref-property-setget
  357. - |void| **set_scrolling_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  358. - :ref:`bool<class_bool>` **get_scrolling_enabled**\ (\ )
  359. if ``true``, the mouse's scroll wheel can be used to navigate the scroll view.
  360. .. rst-class:: classref-item-separator
  361. ----
  362. .. _class_TabBar_property_select_with_rmb:
  363. .. rst-class:: classref-property
  364. :ref:`bool<class_bool>` **select_with_rmb** = ``false`` :ref:`๐Ÿ”—<class_TabBar_property_select_with_rmb>`
  365. .. rst-class:: classref-property-setget
  366. - |void| **set_select_with_rmb**\ (\ value\: :ref:`bool<class_bool>`\ )
  367. - :ref:`bool<class_bool>` **get_select_with_rmb**\ (\ )
  368. If ``true``, enables selecting a tab with the right mouse button.
  369. .. rst-class:: classref-item-separator
  370. ----
  371. .. _class_TabBar_property_tab_alignment:
  372. .. rst-class:: classref-property
  373. :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **tab_alignment** = ``0`` :ref:`๐Ÿ”—<class_TabBar_property_tab_alignment>`
  374. .. rst-class:: classref-property-setget
  375. - |void| **set_tab_alignment**\ (\ value\: :ref:`AlignmentMode<enum_TabBar_AlignmentMode>`\ )
  376. - :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **get_tab_alignment**\ (\ )
  377. The position at which tabs will be placed.
  378. .. rst-class:: classref-item-separator
  379. ----
  380. .. _class_TabBar_property_tab_close_display_policy:
  381. .. rst-class:: classref-property
  382. :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` **tab_close_display_policy** = ``0`` :ref:`๐Ÿ”—<class_TabBar_property_tab_close_display_policy>`
  383. .. rst-class:: classref-property-setget
  384. - |void| **set_tab_close_display_policy**\ (\ value\: :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>`\ )
  385. - :ref:`CloseButtonDisplayPolicy<enum_TabBar_CloseButtonDisplayPolicy>` **get_tab_close_display_policy**\ (\ )
  386. When the close button will appear on the tabs.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_TabBar_property_tab_count:
  390. .. rst-class:: classref-property
  391. :ref:`int<class_int>` **tab_count** = ``0`` :ref:`๐Ÿ”—<class_TabBar_property_tab_count>`
  392. .. rst-class:: classref-property-setget
  393. - |void| **set_tab_count**\ (\ value\: :ref:`int<class_int>`\ )
  394. - :ref:`int<class_int>` **get_tab_count**\ (\ )
  395. The number of tabs currently in the bar.
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_TabBar_property_tabs_rearrange_group:
  399. .. rst-class:: classref-property
  400. :ref:`int<class_int>` **tabs_rearrange_group** = ``-1`` :ref:`๐Ÿ”—<class_TabBar_property_tabs_rearrange_group>`
  401. .. rst-class:: classref-property-setget
  402. - |void| **set_tabs_rearrange_group**\ (\ value\: :ref:`int<class_int>`\ )
  403. - :ref:`int<class_int>` **get_tabs_rearrange_group**\ (\ )
  404. **TabBar**\ s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with :ref:`drag_to_rearrange_enabled<class_TabBar_property_drag_to_rearrange_enabled>`.
  405. Setting this to ``-1`` will disable rearranging between **TabBar**\ s.
  406. .. rst-class:: classref-section-separator
  407. ----
  408. .. rst-class:: classref-descriptions-group
  409. Method Descriptions
  410. -------------------
  411. .. _class_TabBar_method_add_tab:
  412. .. rst-class:: classref-method
  413. |void| **add_tab**\ (\ title\: :ref:`String<class_String>` = "", icon\: :ref:`Texture2D<class_Texture2D>` = null\ ) :ref:`๐Ÿ”—<class_TabBar_method_add_tab>`
  414. Adds a new tab.
  415. .. rst-class:: classref-item-separator
  416. ----
  417. .. _class_TabBar_method_clear_tabs:
  418. .. rst-class:: classref-method
  419. |void| **clear_tabs**\ (\ ) :ref:`๐Ÿ”—<class_TabBar_method_clear_tabs>`
  420. Clears all tabs.
  421. .. rst-class:: classref-item-separator
  422. ----
  423. .. _class_TabBar_method_ensure_tab_visible:
  424. .. rst-class:: classref-method
  425. |void| **ensure_tab_visible**\ (\ idx\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_ensure_tab_visible>`
  426. Moves the scroll view to make the tab visible.
  427. .. rst-class:: classref-item-separator
  428. ----
  429. .. _class_TabBar_method_get_offset_buttons_visible:
  430. .. rst-class:: classref-method
  431. :ref:`bool<class_bool>` **get_offset_buttons_visible**\ (\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_offset_buttons_visible>`
  432. Returns ``true`` if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.
  433. .. rst-class:: classref-item-separator
  434. ----
  435. .. _class_TabBar_method_get_previous_tab:
  436. .. rst-class:: classref-method
  437. :ref:`int<class_int>` **get_previous_tab**\ (\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_previous_tab>`
  438. Returns the previously active tab index.
  439. .. rst-class:: classref-item-separator
  440. ----
  441. .. _class_TabBar_method_get_tab_button_icon:
  442. .. rst-class:: classref-method
  443. :ref:`Texture2D<class_Texture2D>` **get_tab_button_icon**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_button_icon>`
  444. Returns the icon for the right button of the tab at index ``tab_idx`` or ``null`` if the right button has no icon.
  445. .. rst-class:: classref-item-separator
  446. ----
  447. .. _class_TabBar_method_get_tab_icon:
  448. .. rst-class:: classref-method
  449. :ref:`Texture2D<class_Texture2D>` **get_tab_icon**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_icon>`
  450. Returns the icon for the tab at index ``tab_idx`` or ``null`` if the tab has no icon.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_TabBar_method_get_tab_icon_max_width:
  454. .. rst-class:: classref-method
  455. :ref:`int<class_int>` **get_tab_icon_max_width**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_icon_max_width>`
  456. Returns the maximum allowed width of the icon for the tab at index ``tab_idx``.
  457. .. rst-class:: classref-item-separator
  458. ----
  459. .. _class_TabBar_method_get_tab_idx_at_point:
  460. .. rst-class:: classref-method
  461. :ref:`int<class_int>` **get_tab_idx_at_point**\ (\ point\: :ref:`Vector2<class_Vector2>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_idx_at_point>`
  462. 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.
  463. .. rst-class:: classref-item-separator
  464. ----
  465. .. _class_TabBar_method_get_tab_language:
  466. .. rst-class:: classref-method
  467. :ref:`String<class_String>` **get_tab_language**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_language>`
  468. Returns tab title language code.
  469. .. rst-class:: classref-item-separator
  470. ----
  471. .. _class_TabBar_method_get_tab_metadata:
  472. .. rst-class:: classref-method
  473. :ref:`Variant<class_Variant>` **get_tab_metadata**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_metadata>`
  474. Returns the metadata value set to the tab at index ``tab_idx`` using :ref:`set_tab_metadata()<class_TabBar_method_set_tab_metadata>`. If no metadata was previously set, returns ``null`` by default.
  475. .. rst-class:: classref-item-separator
  476. ----
  477. .. _class_TabBar_method_get_tab_offset:
  478. .. rst-class:: classref-method
  479. :ref:`int<class_int>` **get_tab_offset**\ (\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_offset>`
  480. Returns the number of hidden tabs offsetted to the left.
  481. .. rst-class:: classref-item-separator
  482. ----
  483. .. _class_TabBar_method_get_tab_rect:
  484. .. rst-class:: classref-method
  485. :ref:`Rect2<class_Rect2>` **get_tab_rect**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_rect>`
  486. Returns tab :ref:`Rect2<class_Rect2>` with local position and size.
  487. .. rst-class:: classref-item-separator
  488. ----
  489. .. _class_TabBar_method_get_tab_text_direction:
  490. .. rst-class:: classref-method
  491. :ref:`TextDirection<enum_Control_TextDirection>` **get_tab_text_direction**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_text_direction>`
  492. Returns tab title text base writing direction.
  493. .. rst-class:: classref-item-separator
  494. ----
  495. .. _class_TabBar_method_get_tab_title:
  496. .. rst-class:: classref-method
  497. :ref:`String<class_String>` **get_tab_title**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_title>`
  498. Returns the title of the tab at index ``tab_idx``.
  499. .. rst-class:: classref-item-separator
  500. ----
  501. .. _class_TabBar_method_get_tab_tooltip:
  502. .. rst-class:: classref-method
  503. :ref:`String<class_String>` **get_tab_tooltip**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_get_tab_tooltip>`
  504. Returns the tooltip text of the tab at index ``tab_idx``.
  505. .. rst-class:: classref-item-separator
  506. ----
  507. .. _class_TabBar_method_is_tab_disabled:
  508. .. rst-class:: classref-method
  509. :ref:`bool<class_bool>` **is_tab_disabled**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_is_tab_disabled>`
  510. Returns ``true`` if the tab at index ``tab_idx`` is disabled.
  511. .. rst-class:: classref-item-separator
  512. ----
  513. .. _class_TabBar_method_is_tab_hidden:
  514. .. rst-class:: classref-method
  515. :ref:`bool<class_bool>` **is_tab_hidden**\ (\ tab_idx\: :ref:`int<class_int>`\ ) |const| :ref:`๐Ÿ”—<class_TabBar_method_is_tab_hidden>`
  516. Returns ``true`` if the tab at index ``tab_idx`` is hidden.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_TabBar_method_move_tab:
  520. .. rst-class:: classref-method
  521. |void| **move_tab**\ (\ from\: :ref:`int<class_int>`, to\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_move_tab>`
  522. Moves a tab from ``from`` to ``to``.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_TabBar_method_remove_tab:
  526. .. rst-class:: classref-method
  527. |void| **remove_tab**\ (\ tab_idx\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_remove_tab>`
  528. Removes the tab at index ``tab_idx``.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _class_TabBar_method_select_next_available:
  532. .. rst-class:: classref-method
  533. :ref:`bool<class_bool>` **select_next_available**\ (\ ) :ref:`๐Ÿ”—<class_TabBar_method_select_next_available>`
  534. Selects the first available tab with greater index than the currently selected. Returns ``true`` if tab selection changed.
  535. .. rst-class:: classref-item-separator
  536. ----
  537. .. _class_TabBar_method_select_previous_available:
  538. .. rst-class:: classref-method
  539. :ref:`bool<class_bool>` **select_previous_available**\ (\ ) :ref:`๐Ÿ”—<class_TabBar_method_select_previous_available>`
  540. Selects the first available tab with lower index than the currently selected. Returns ``true`` if tab selection changed.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_TabBar_method_set_tab_button_icon:
  544. .. rst-class:: classref-method
  545. |void| **set_tab_button_icon**\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_button_icon>`
  546. Sets an ``icon`` for the button of the tab at index ``tab_idx`` (located to the right, before the close button), making it visible and clickable (See :ref:`tab_button_pressed<class_TabBar_signal_tab_button_pressed>`). Giving it a ``null`` value will hide the button.
  547. .. rst-class:: classref-item-separator
  548. ----
  549. .. _class_TabBar_method_set_tab_disabled:
  550. .. rst-class:: classref-method
  551. |void| **set_tab_disabled**\ (\ tab_idx\: :ref:`int<class_int>`, disabled\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_disabled>`
  552. If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable.
  553. .. rst-class:: classref-item-separator
  554. ----
  555. .. _class_TabBar_method_set_tab_hidden:
  556. .. rst-class:: classref-method
  557. |void| **set_tab_hidden**\ (\ tab_idx\: :ref:`int<class_int>`, hidden\: :ref:`bool<class_bool>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_hidden>`
  558. If ``hidden`` is ``true``, hides the tab at index ``tab_idx``, making it disappear from the tab area.
  559. .. rst-class:: classref-item-separator
  560. ----
  561. .. _class_TabBar_method_set_tab_icon:
  562. .. rst-class:: classref-method
  563. |void| **set_tab_icon**\ (\ tab_idx\: :ref:`int<class_int>`, icon\: :ref:`Texture2D<class_Texture2D>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_icon>`
  564. Sets an ``icon`` for the tab at index ``tab_idx``.
  565. .. rst-class:: classref-item-separator
  566. ----
  567. .. _class_TabBar_method_set_tab_icon_max_width:
  568. .. rst-class:: classref-method
  569. |void| **set_tab_icon_max_width**\ (\ tab_idx\: :ref:`int<class_int>`, width\: :ref:`int<class_int>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_icon_max_width>`
  570. 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_TabBar_theme_constant_icon_max_width>`. The height is adjusted according to the icon's ratio.
  571. .. rst-class:: classref-item-separator
  572. ----
  573. .. _class_TabBar_method_set_tab_language:
  574. .. rst-class:: classref-method
  575. |void| **set_tab_language**\ (\ tab_idx\: :ref:`int<class_int>`, language\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_language>`
  576. Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
  577. .. rst-class:: classref-item-separator
  578. ----
  579. .. _class_TabBar_method_set_tab_metadata:
  580. .. rst-class:: classref-method
  581. |void| **set_tab_metadata**\ (\ tab_idx\: :ref:`int<class_int>`, metadata\: :ref:`Variant<class_Variant>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_metadata>`
  582. Sets the metadata value for the tab at index ``tab_idx``, which can be retrieved later using :ref:`get_tab_metadata()<class_TabBar_method_get_tab_metadata>`.
  583. .. rst-class:: classref-item-separator
  584. ----
  585. .. _class_TabBar_method_set_tab_text_direction:
  586. .. rst-class:: classref-method
  587. |void| **set_tab_text_direction**\ (\ tab_idx\: :ref:`int<class_int>`, direction\: :ref:`TextDirection<enum_Control_TextDirection>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_text_direction>`
  588. Sets tab title base writing direction.
  589. .. rst-class:: classref-item-separator
  590. ----
  591. .. _class_TabBar_method_set_tab_title:
  592. .. rst-class:: classref-method
  593. |void| **set_tab_title**\ (\ tab_idx\: :ref:`int<class_int>`, title\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_title>`
  594. Sets a ``title`` for the tab at index ``tab_idx``.
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_TabBar_method_set_tab_tooltip:
  598. .. rst-class:: classref-method
  599. |void| **set_tab_tooltip**\ (\ tab_idx\: :ref:`int<class_int>`, tooltip\: :ref:`String<class_String>`\ ) :ref:`๐Ÿ”—<class_TabBar_method_set_tab_tooltip>`
  600. Sets a ``tooltip`` for tab at index ``tab_idx``.
  601. \ **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.
  602. .. rst-class:: classref-section-separator
  603. ----
  604. .. rst-class:: classref-descriptions-group
  605. Theme Property Descriptions
  606. ---------------------------
  607. .. _class_TabBar_theme_color_drop_mark_color:
  608. .. rst-class:: classref-themeproperty
  609. :ref:`Color<class_Color>` **drop_mark_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_drop_mark_color>`
  610. Modulation color for the :ref:`drop_mark<class_TabBar_theme_icon_drop_mark>` icon.
  611. .. rst-class:: classref-item-separator
  612. ----
  613. .. _class_TabBar_theme_color_font_disabled_color:
  614. .. rst-class:: classref-themeproperty
  615. :ref:`Color<class_Color>` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_font_disabled_color>`
  616. Font color of disabled tabs.
  617. .. rst-class:: classref-item-separator
  618. ----
  619. .. _class_TabBar_theme_color_font_hovered_color:
  620. .. rst-class:: classref-themeproperty
  621. :ref:`Color<class_Color>` **font_hovered_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_font_hovered_color>`
  622. Font color of the currently hovered tab. Does not apply to the selected tab.
  623. .. rst-class:: classref-item-separator
  624. ----
  625. .. _class_TabBar_theme_color_font_outline_color:
  626. .. rst-class:: classref-themeproperty
  627. :ref:`Color<class_Color>` **font_outline_color** = ``Color(0, 0, 0, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_font_outline_color>`
  628. The tint of text outline of the tab name.
  629. .. rst-class:: classref-item-separator
  630. ----
  631. .. _class_TabBar_theme_color_font_selected_color:
  632. .. rst-class:: classref-themeproperty
  633. :ref:`Color<class_Color>` **font_selected_color** = ``Color(0.95, 0.95, 0.95, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_font_selected_color>`
  634. Font color of the currently selected tab.
  635. .. rst-class:: classref-item-separator
  636. ----
  637. .. _class_TabBar_theme_color_font_unselected_color:
  638. .. rst-class:: classref-themeproperty
  639. :ref:`Color<class_Color>` **font_unselected_color** = ``Color(0.7, 0.7, 0.7, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_font_unselected_color>`
  640. Font color of the other, unselected tabs.
  641. .. rst-class:: classref-item-separator
  642. ----
  643. .. _class_TabBar_theme_color_icon_disabled_color:
  644. .. rst-class:: classref-themeproperty
  645. :ref:`Color<class_Color>` **icon_disabled_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_icon_disabled_color>`
  646. Icon color of disabled tabs.
  647. .. rst-class:: classref-item-separator
  648. ----
  649. .. _class_TabBar_theme_color_icon_hovered_color:
  650. .. rst-class:: classref-themeproperty
  651. :ref:`Color<class_Color>` **icon_hovered_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_icon_hovered_color>`
  652. Icon color of the currently hovered tab. Does not apply to the selected tab.
  653. .. rst-class:: classref-item-separator
  654. ----
  655. .. _class_TabBar_theme_color_icon_selected_color:
  656. .. rst-class:: classref-themeproperty
  657. :ref:`Color<class_Color>` **icon_selected_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_icon_selected_color>`
  658. Icon color of the currently selected tab.
  659. .. rst-class:: classref-item-separator
  660. ----
  661. .. _class_TabBar_theme_color_icon_unselected_color:
  662. .. rst-class:: classref-themeproperty
  663. :ref:`Color<class_Color>` **icon_unselected_color** = ``Color(1, 1, 1, 1)`` :ref:`๐Ÿ”—<class_TabBar_theme_color_icon_unselected_color>`
  664. Icon color of the other, unselected tabs.
  665. .. rst-class:: classref-item-separator
  666. ----
  667. .. _class_TabBar_theme_constant_h_separation:
  668. .. rst-class:: classref-themeproperty
  669. :ref:`int<class_int>` **h_separation** = ``4`` :ref:`๐Ÿ”—<class_TabBar_theme_constant_h_separation>`
  670. The horizontal separation between the elements inside tabs.
  671. .. rst-class:: classref-item-separator
  672. ----
  673. .. _class_TabBar_theme_constant_icon_max_width:
  674. .. rst-class:: classref-themeproperty
  675. :ref:`int<class_int>` **icon_max_width** = ``0`` :ref:`๐Ÿ”—<class_TabBar_theme_constant_icon_max_width>`
  676. 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:`set_tab_icon_max_width()<class_TabBar_method_set_tab_icon_max_width>`. The height is adjusted according to the icon's ratio.
  677. .. rst-class:: classref-item-separator
  678. ----
  679. .. _class_TabBar_theme_constant_outline_size:
  680. .. rst-class:: classref-themeproperty
  681. :ref:`int<class_int>` **outline_size** = ``0`` :ref:`๐Ÿ”—<class_TabBar_theme_constant_outline_size>`
  682. The size of the tab text outline.
  683. \ **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_TabBar_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
  684. .. rst-class:: classref-item-separator
  685. ----
  686. .. _class_TabBar_theme_constant_tab_separation:
  687. .. rst-class:: classref-themeproperty
  688. :ref:`int<class_int>` **tab_separation** = ``0`` :ref:`๐Ÿ”—<class_TabBar_theme_constant_tab_separation>`
  689. The space between tabs in the tab bar.
  690. .. rst-class:: classref-item-separator
  691. ----
  692. .. _class_TabBar_theme_font_font:
  693. .. rst-class:: classref-themeproperty
  694. :ref:`Font<class_Font>` **font** :ref:`๐Ÿ”—<class_TabBar_theme_font_font>`
  695. The font used to draw tab names.
  696. .. rst-class:: classref-item-separator
  697. ----
  698. .. _class_TabBar_theme_font_size_font_size:
  699. .. rst-class:: classref-themeproperty
  700. :ref:`int<class_int>` **font_size** :ref:`๐Ÿ”—<class_TabBar_theme_font_size_font_size>`
  701. Font size of the tab names.
  702. .. rst-class:: classref-item-separator
  703. ----
  704. .. _class_TabBar_theme_icon_close:
  705. .. rst-class:: classref-themeproperty
  706. :ref:`Texture2D<class_Texture2D>` **close** :ref:`๐Ÿ”—<class_TabBar_theme_icon_close>`
  707. The icon for the close button (see :ref:`tab_close_display_policy<class_TabBar_property_tab_close_display_policy>`).
  708. .. rst-class:: classref-item-separator
  709. ----
  710. .. _class_TabBar_theme_icon_decrement:
  711. .. rst-class:: classref-themeproperty
  712. :ref:`Texture2D<class_Texture2D>` **decrement** :ref:`๐Ÿ”—<class_TabBar_theme_icon_decrement>`
  713. 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.
  714. .. rst-class:: classref-item-separator
  715. ----
  716. .. _class_TabBar_theme_icon_decrement_highlight:
  717. .. rst-class:: classref-themeproperty
  718. :ref:`Texture2D<class_Texture2D>` **decrement_highlight** :ref:`๐Ÿ”—<class_TabBar_theme_icon_decrement_highlight>`
  719. 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.
  720. .. rst-class:: classref-item-separator
  721. ----
  722. .. _class_TabBar_theme_icon_drop_mark:
  723. .. rst-class:: classref-themeproperty
  724. :ref:`Texture2D<class_Texture2D>` **drop_mark** :ref:`๐Ÿ”—<class_TabBar_theme_icon_drop_mark>`
  725. Icon shown to indicate where a dragged tab is gonna be dropped (see :ref:`drag_to_rearrange_enabled<class_TabBar_property_drag_to_rearrange_enabled>`).
  726. .. rst-class:: classref-item-separator
  727. ----
  728. .. _class_TabBar_theme_icon_increment:
  729. .. rst-class:: classref-themeproperty
  730. :ref:`Texture2D<class_Texture2D>` **increment** :ref:`๐Ÿ”—<class_TabBar_theme_icon_increment>`
  731. 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.
  732. .. rst-class:: classref-item-separator
  733. ----
  734. .. _class_TabBar_theme_icon_increment_highlight:
  735. .. rst-class:: classref-themeproperty
  736. :ref:`Texture2D<class_Texture2D>` **increment_highlight** :ref:`๐Ÿ”—<class_TabBar_theme_icon_increment_highlight>`
  737. 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.
  738. .. rst-class:: classref-item-separator
  739. ----
  740. .. _class_TabBar_theme_style_button_highlight:
  741. .. rst-class:: classref-themeproperty
  742. :ref:`StyleBox<class_StyleBox>` **button_highlight** :ref:`๐Ÿ”—<class_TabBar_theme_style_button_highlight>`
  743. Background of the tab and close buttons when they're being hovered with the cursor.
  744. .. rst-class:: classref-item-separator
  745. ----
  746. .. _class_TabBar_theme_style_button_pressed:
  747. .. rst-class:: classref-themeproperty
  748. :ref:`StyleBox<class_StyleBox>` **button_pressed** :ref:`๐Ÿ”—<class_TabBar_theme_style_button_pressed>`
  749. Background of the tab and close buttons when it's being pressed.
  750. .. rst-class:: classref-item-separator
  751. ----
  752. .. _class_TabBar_theme_style_tab_disabled:
  753. .. rst-class:: classref-themeproperty
  754. :ref:`StyleBox<class_StyleBox>` **tab_disabled** :ref:`๐Ÿ”—<class_TabBar_theme_style_tab_disabled>`
  755. The style of disabled tabs.
  756. .. rst-class:: classref-item-separator
  757. ----
  758. .. _class_TabBar_theme_style_tab_focus:
  759. .. rst-class:: classref-themeproperty
  760. :ref:`StyleBox<class_StyleBox>` **tab_focus** :ref:`๐Ÿ”—<class_TabBar_theme_style_tab_focus>`
  761. :ref:`StyleBox<class_StyleBox>` used when the **TabBar** is focused. The :ref:`tab_focus<class_TabBar_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.
  762. .. rst-class:: classref-item-separator
  763. ----
  764. .. _class_TabBar_theme_style_tab_hovered:
  765. .. rst-class:: classref-themeproperty
  766. :ref:`StyleBox<class_StyleBox>` **tab_hovered** :ref:`๐Ÿ”—<class_TabBar_theme_style_tab_hovered>`
  767. The style of the currently hovered tab. Does not apply to the selected tab.
  768. \ **Note:** This style will be drawn with the same width as :ref:`tab_unselected<class_TabBar_theme_style_tab_unselected>` at minimum.
  769. .. rst-class:: classref-item-separator
  770. ----
  771. .. _class_TabBar_theme_style_tab_selected:
  772. .. rst-class:: classref-themeproperty
  773. :ref:`StyleBox<class_StyleBox>` **tab_selected** :ref:`๐Ÿ”—<class_TabBar_theme_style_tab_selected>`
  774. The style of the currently selected tab.
  775. .. rst-class:: classref-item-separator
  776. ----
  777. .. _class_TabBar_theme_style_tab_unselected:
  778. .. rst-class:: classref-themeproperty
  779. :ref:`StyleBox<class_StyleBox>` **tab_unselected** :ref:`๐Ÿ”—<class_TabBar_theme_style_tab_unselected>`
  780. The style of the other, unselected tabs.
  781. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  782. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  783. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  784. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  785. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  786. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  787. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  788. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  789. .. |void| replace:: :abbr:`void (No return value.)`