class_tabbar.rst 64 KB

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