123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.0/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/TabContainer.xml.
- .. _class_TabContainer:
- TabContainer
- ============
- **Inherits:** :ref:`Container<class_Container>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- A container that creates a tab for each child control, displaying only the active tab's control.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- Arranges child controls into a tabbed view, creating a tab for each one. The active tab's corresponding control is made visible, while all other child controls are hidden. Ignores non-control children.
- \ **Note:** The drawing of the clickable tabs is handled by this node; :ref:`TabBar<class_TabBar>` is not needed.
- .. rst-class:: classref-introduction-group
- Tutorials
- ---------
- - :doc:`Using Containers <../tutorials/ui/gui_containers>`
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`all_tabs_in_front<class_TabContainer_property_all_tabs_in_front>` | ``false`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`clip_tabs<class_TabContainer_property_clip_tabs>` | ``true`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`int<class_int>` | :ref:`current_tab<class_TabContainer_property_current_tab>` | ``0`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>` | ``false`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` | :ref:`tab_alignment<class_TabContainer_property_tab_alignment>` | ``0`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`int<class_int>` | :ref:`tabs_rearrange_group<class_TabContainer_property_tabs_rearrange_group>` | ``-1`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`tabs_visible<class_TabContainer_property_tabs_visible>` | ``true`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- | :ref:`bool<class_bool>` | :ref:`use_hidden_tabs_for_min_size<class_TabContainer_property_use_hidden_tabs_for_min_size>` | ``false`` |
- +-------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Control<class_Control>` | :ref:`get_current_tab_control<class_TabContainer_method_get_current_tab_control>` **(** **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Popup<class_Popup>` | :ref:`get_popup<class_TabContainer_method_get_popup>` **(** **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_previous_tab<class_TabContainer_method_get_previous_tab>` **(** **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`get_tab_button_icon<class_TabContainer_method_get_tab_button_icon>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Control<class_Control>` | :ref:`get_tab_control<class_TabContainer_method_get_tab_control>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_tab_count<class_TabContainer_method_get_tab_count>` **(** **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`get_tab_icon<class_TabContainer_method_get_tab_icon>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_tab_idx_at_point<class_TabContainer_method_get_tab_idx_at_point>` **(** :ref:`Vector2<class_Vector2>` point **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`int<class_int>` | :ref:`get_tab_idx_from_control<class_TabContainer_method_get_tab_idx_from_control>` **(** :ref:`Control<class_Control>` control **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`String<class_String>` | :ref:`get_tab_title<class_TabContainer_method_get_tab_title>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_tab_disabled<class_TabContainer_method_is_tab_disabled>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`is_tab_hidden<class_TabContainer_method_is_tab_hidden>` **(** :ref:`int<class_int>` tab_idx **)** |const| |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_popup<class_TabContainer_method_set_popup>` **(** :ref:`Node<class_Node>` popup **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_button_icon<class_TabContainer_method_set_tab_button_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture2D<class_Texture2D>` icon **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_disabled<class_TabContainer_method_set_tab_disabled>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_hidden<class_TabContainer_method_set_tab_hidden>` **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` hidden **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_icon<class_TabContainer_method_set_tab_icon>` **(** :ref:`int<class_int>` tab_idx, :ref:`Texture2D<class_Texture2D>` icon **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_tab_title<class_TabContainer_method_set_tab_title>` **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)** |
- +-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+
- .. rst-class:: classref-reftable-group
- Theme Properties
- ----------------
- .. table::
- :widths: auto
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`drop_mark_color<class_TabContainer_theme_color_drop_mark_color>` | ``Color(1, 1, 1, 1)`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_disabled_color<class_TabContainer_theme_color_font_disabled_color>` | ``Color(0.875, 0.875, 0.875, 0.5)`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_outline_color<class_TabContainer_theme_color_font_outline_color>` | ``Color(1, 1, 1, 1)`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_selected_color<class_TabContainer_theme_color_font_selected_color>` | ``Color(0.95, 0.95, 0.95, 1)`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Color<class_Color>` | :ref:`font_unselected_color<class_TabContainer_theme_color_font_unselected_color>` | ``Color(0.7, 0.7, 0.7, 1)`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`int<class_int>` | :ref:`icon_separation<class_TabContainer_theme_constant_icon_separation>` | ``4`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`int<class_int>` | :ref:`outline_size<class_TabContainer_theme_constant_outline_size>` | ``0`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`int<class_int>` | :ref:`side_margin<class_TabContainer_theme_constant_side_margin>` | ``8`` |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Font<class_Font>` | :ref:`font<class_TabContainer_theme_font_font>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`int<class_int>` | :ref:`font_size<class_TabContainer_theme_font_size_font_size>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`decrement<class_TabContainer_theme_icon_decrement>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`decrement_highlight<class_TabContainer_theme_icon_decrement_highlight>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`drop_mark<class_TabContainer_theme_icon_drop_mark>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`increment<class_TabContainer_theme_icon_increment>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`increment_highlight<class_TabContainer_theme_icon_increment_highlight>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`menu<class_TabContainer_theme_icon_menu>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`Texture2D<class_Texture2D>` | :ref:`menu_highlight<class_TabContainer_theme_icon_menu_highlight>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`panel<class_TabContainer_theme_style_panel>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_disabled<class_TabContainer_theme_style_tab_disabled>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_selected<class_TabContainer_theme_style_tab_selected>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`tab_unselected<class_TabContainer_theme_style_tab_unselected>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- | :ref:`StyleBox<class_StyleBox>` | :ref:`tabbar_background<class_TabContainer_theme_style_tabbar_background>` | |
- +-----------------------------------+------------------------------------------------------------------------------------+-------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Signals
- -------
- .. _class_TabContainer_signal_pre_popup_pressed:
- .. rst-class:: classref-signal
- **pre_popup_pressed** **(** **)**
- Emitted when the **TabContainer**'s :ref:`Popup<class_Popup>` button is clicked. See :ref:`set_popup<class_TabContainer_method_set_popup>` for details.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_signal_tab_button_pressed:
- .. rst-class:: classref-signal
- **tab_button_pressed** **(** :ref:`int<class_int>` tab **)**
- Emitted when the user clicks on the button icon on this tab.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_signal_tab_changed:
- .. rst-class:: classref-signal
- **tab_changed** **(** :ref:`int<class_int>` tab **)**
- Emitted when switching to another tab.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_signal_tab_selected:
- .. rst-class:: classref-signal
- **tab_selected** **(** :ref:`int<class_int>` tab **)**
- Emitted when a tab is selected, even if it is the current tab.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_TabContainer_property_all_tabs_in_front:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **all_tabs_in_front** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_all_tabs_in_front** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **is_all_tabs_in_front** **(** **)**
- If ``true``, all tabs are drawn in front of the panel. If ``false``, inactive tabs are drawn behind the panel.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_clip_tabs:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **clip_tabs** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_clip_tabs** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_clip_tabs** **(** **)**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_current_tab:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **current_tab** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_current_tab** **(** :ref:`int<class_int>` value **)**
- - :ref:`int<class_int>` **get_current_tab** **(** **)**
- The current tab index. When set, this index's :ref:`Control<class_Control>` node's ``visible`` property is set to ``true`` and all others are set to ``false``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_drag_to_rearrange_enabled:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **drag_to_rearrange_enabled** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_drag_to_rearrange_enabled** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_drag_to_rearrange_enabled** **(** **)**
- If ``true``, tabs can be rearranged with mouse drag.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_tab_alignment:
- .. rst-class:: classref-property
- :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **tab_alignment** = ``0``
- .. rst-class:: classref-property-setget
- - void **set_tab_alignment** **(** :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` value **)**
- - :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` **get_tab_alignment** **(** **)**
- Sets the position at which tabs will be placed. See :ref:`AlignmentMode<enum_TabBar_AlignmentMode>` for details.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_tabs_rearrange_group:
- .. rst-class:: classref-property
- :ref:`int<class_int>` **tabs_rearrange_group** = ``-1``
- .. rst-class:: classref-property-setget
- - void **set_tabs_rearrange_group** **(** :ref:`int<class_int>` value **)**
- - :ref:`int<class_int>` **get_tabs_rearrange_group** **(** **)**
- **TabContainer**\ s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`.
- Setting this to ``-1`` will disable rearranging between **TabContainer**\ s.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_tabs_visible:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **tabs_visible** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_tabs_visible** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **are_tabs_visible** **(** **)**
- If ``true``, tabs are visible. If ``false``, tabs' content and titles are hidden.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_property_use_hidden_tabs_for_min_size:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **use_hidden_tabs_for_min_size** = ``false``
- .. rst-class:: classref-property-setget
- - void **set_use_hidden_tabs_for_min_size** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_use_hidden_tabs_for_min_size** **(** **)**
- If ``true``, children :ref:`Control<class_Control>` nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_TabContainer_method_get_current_tab_control:
- .. rst-class:: classref-method
- :ref:`Control<class_Control>` **get_current_tab_control** **(** **)** |const|
- Returns the child :ref:`Control<class_Control>` node located at the active tab index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_popup:
- .. rst-class:: classref-method
- :ref:`Popup<class_Popup>` **get_popup** **(** **)** |const|
- Returns the :ref:`Popup<class_Popup>` node instance if one has been set already with :ref:`set_popup<class_TabContainer_method_set_popup>`.
- \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`Window.visible<class_Window_property_visible>` property.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_previous_tab:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_previous_tab** **(** **)** |const|
- Returns the previously active tab index.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_button_icon:
- .. rst-class:: classref-method
- :ref:`Texture2D<class_Texture2D>` **get_tab_button_icon** **(** :ref:`int<class_int>` tab_idx **)** |const|
- Returns the button icon from the tab at index ``tab_idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_control:
- .. rst-class:: classref-method
- :ref:`Control<class_Control>` **get_tab_control** **(** :ref:`int<class_int>` tab_idx **)** |const|
- Returns the :ref:`Control<class_Control>` node from the tab at index ``tab_idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_count:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_tab_count** **(** **)** |const|
- Returns the number of tabs.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_icon:
- .. rst-class:: classref-method
- :ref:`Texture2D<class_Texture2D>` **get_tab_icon** **(** :ref:`int<class_int>` tab_idx **)** |const|
- Returns the :ref:`Texture2D<class_Texture2D>` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture2D<class_Texture2D>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_idx_at_point:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_tab_idx_at_point** **(** :ref:`Vector2<class_Vector2>` point **)** |const|
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_idx_from_control:
- .. rst-class:: classref-method
- :ref:`int<class_int>` **get_tab_idx_from_control** **(** :ref:`Control<class_Control>` control **)** |const|
- Returns the index of the tab tied to the given ``control``. The control must be a child of the **TabContainer**.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_get_tab_title:
- .. rst-class:: classref-method
- :ref:`String<class_String>` **get_tab_title** **(** :ref:`int<class_int>` tab_idx **)** |const|
- Returns the title of the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node, but this can be overridden with :ref:`set_tab_title<class_TabContainer_method_set_tab_title>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_is_tab_disabled:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_tab_disabled** **(** :ref:`int<class_int>` tab_idx **)** |const|
- Returns ``true`` if the tab at index ``tab_idx`` is disabled.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_is_tab_hidden:
- .. rst-class:: classref-method
- :ref:`bool<class_bool>` **is_tab_hidden** **(** :ref:`int<class_int>` tab_idx **)** |const|
- Returns ``true`` if the tab at index ``tab_idx`` is hidden.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_set_popup:
- .. rst-class:: classref-method
- void **set_popup** **(** :ref:`Node<class_Node>` popup **)**
- If set on a :ref:`Popup<class_Popup>` node instance, a popup menu icon appears in the top-right corner of the **TabContainer** (setting it to ``null`` will make it go away). Clicking it will expand the :ref:`Popup<class_Popup>` node.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_set_tab_button_icon:
- .. rst-class:: classref-method
- void **set_tab_button_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture2D<class_Texture2D>` icon **)**
- Sets the button icon from the tab at index ``tab_idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_set_tab_disabled:
- .. rst-class:: classref-method
- void **set_tab_disabled** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` disabled **)**
- If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_set_tab_hidden:
- .. rst-class:: classref-method
- void **set_tab_hidden** **(** :ref:`int<class_int>` tab_idx, :ref:`bool<class_bool>` hidden **)**
- If ``hidden`` is ``true``, hides the tab at index ``tab_idx``, making it disappear from the tab area.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_set_tab_icon:
- .. rst-class:: classref-method
- void **set_tab_icon** **(** :ref:`int<class_int>` tab_idx, :ref:`Texture2D<class_Texture2D>` icon **)**
- Sets an icon for the tab at index ``tab_idx``.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_method_set_tab_title:
- .. rst-class:: classref-method
- void **set_tab_title** **(** :ref:`int<class_int>` tab_idx, :ref:`String<class_String>` title **)**
- Sets a custom title for the tab at index ``tab_idx`` (tab titles default to the name of the indexed child node). Set it back to the child's name to make the tab default to it again.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Theme Property Descriptions
- ---------------------------
- .. _class_TabContainer_theme_color_drop_mark_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **drop_mark_color** = ``Color(1, 1, 1, 1)``
- Modulation color for the :ref:`drop_mark<class_TabContainer_theme_icon_drop_mark>` icon.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_color_font_disabled_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_disabled_color** = ``Color(0.875, 0.875, 0.875, 0.5)``
- Font color of disabled tabs.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_color_font_outline_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_outline_color** = ``Color(1, 1, 1, 1)``
- The tint of text outline of the tab name.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_color_font_selected_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_selected_color** = ``Color(0.95, 0.95, 0.95, 1)``
- Font color of the currently selected tab.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_color_font_unselected_color:
- .. rst-class:: classref-themeproperty
- :ref:`Color<class_Color>` **font_unselected_color** = ``Color(0.7, 0.7, 0.7, 1)``
- Font color of the other, unselected tabs.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_constant_icon_separation:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **icon_separation** = ``4``
- Space between tab's name and its icon.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_constant_outline_size:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **outline_size** = ``0``
- The size of the tab text outline.
- \ **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_TabContainer_theme_constant_outline_size>` for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_constant_side_margin:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **side_margin** = ``8``
- The space at the left or right edges of the tab bar, accordingly with the current :ref:`tab_alignment<class_TabContainer_property_tab_alignment>`.
- The margin is ignored with :ref:`TabBar.ALIGNMENT_RIGHT<class_TabBar_constant_ALIGNMENT_RIGHT>` if the tabs are clipped (see :ref:`clip_tabs<class_TabContainer_property_clip_tabs>`) or a popup has been set (see :ref:`set_popup<class_TabContainer_method_set_popup>`). The margin is always ignored with :ref:`TabBar.ALIGNMENT_CENTER<class_TabBar_constant_ALIGNMENT_CENTER>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_font_font:
- .. rst-class:: classref-themeproperty
- :ref:`Font<class_Font>` **font**
- The font used to draw tab names.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_font_size_font_size:
- .. rst-class:: classref-themeproperty
- :ref:`int<class_int>` **font_size**
- Font size of the tab names.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_decrement:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **decrement**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_decrement_highlight:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **decrement_highlight**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_drop_mark:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **drop_mark**
- Icon shown to indicate where a dragged tab is gonna be dropped (see :ref:`drag_to_rearrange_enabled<class_TabContainer_property_drag_to_rearrange_enabled>`).
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_increment:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **increment**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_increment_highlight:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **increment_highlight**
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_menu:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **menu**
- The icon for the menu button (see :ref:`set_popup<class_TabContainer_method_set_popup>`).
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_icon_menu_highlight:
- .. rst-class:: classref-themeproperty
- :ref:`Texture2D<class_Texture2D>` **menu_highlight**
- The icon for the menu button (see :ref:`set_popup<class_TabContainer_method_set_popup>`) when it's being hovered with the cursor.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_style_panel:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **panel**
- The style for the background fill.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_style_tab_disabled:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **tab_disabled**
- The style of disabled tabs.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_style_tab_selected:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **tab_selected**
- The style of the currently selected tab.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_style_tab_unselected:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **tab_unselected**
- The style of the other, unselected tabs.
- .. rst-class:: classref-item-separator
- ----
- .. _class_TabContainer_theme_style_tabbar_background:
- .. rst-class:: classref-themeproperty
- :ref:`StyleBox<class_StyleBox>` **tabbar_background**
- The style for the background fill of the :ref:`TabBar<class_TabBar>` area.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
|