class_tabbar.rst 57 KB

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