class_tabbar.rst 62 KB

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