class_tabbar.rst 68 KB

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