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.
Emitted when the active tab is rearranged via mouse drag. See drag_to_rearrange_enabled.
Emitted when the TabContainer's Popup button is clicked. See set_popup() for details.
Emitted when the user clicks on the button icon on this tab.
Emitted when switching to another tab.
Emitted when a tab is clicked, even if it is the current tab.
Emitted when a tab is hovered by the mouse.
Emitted when a tab is selected via click, directional input, or script, even if it is the current tab.
POSITION_TOP = 0
Places the tab bar at the top.
POSITION_BOTTOM = 1
Places the tab bar at the bottom. The tab bar's StyleBox will be flipped vertically.
POSITION_MAX = 2
Represents the size of the TabPosition enum.
If true
, all tabs are drawn in front of the panel. If false
, inactive tabs are drawn behind the panel.
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.
The current tab index. When set, this index's Control node's visible
property is set to true
and all others are set to false
.
A value of -1
means that no tab is selected.
If true
, all tabs can be deselected so that no tab is selected. Click on the current_tab to deselect it.
Only the tab header will be shown if no tabs are selected.
If true
, tabs can be rearranged with mouse drag.
Sets the position at which tabs will be placed. See AlignmentMode for details.
The focus access mode for the internal TabBar node.
Sets the position of the tab bar. See TabPosition for details.
TabContainers with the same rearrange group ID will allow dragging the tabs between them. Enable drag with drag_to_rearrange_enabled.
Setting this to -1
will disable rearranging between TabContainers.
If true
, tabs are visible. If false
, tabs' content and titles are hidden.
If true
, child Control nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one.
Returns the child Control node located at the active tab index.
Returns the Popup node instance if one has been set already with 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 Window.visible property.
Returns the previously active tab index.
Returns the TabBar contained in this container.
Warning: This is a required internal node, removing and freeing it or editing its tabs may cause a crash. If you wish to edit the tabs, use the methods provided in TabContainer.
Returns the button icon from the tab at index tab_idx
.
Returns the Control node from the tab at index tab_idx
.
Returns the number of tabs.
Returns the Texture2D for the tab at index tab_idx
or null
if the tab has no Texture2D.
Returns the maximum allowed width of the icon for the tab at index tab_idx
.
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.
Returns the index of the tab tied to the given control
. The control must be a child of the TabContainer.
Returns the metadata value set to the tab at index tab_idx
using set_tab_metadata(). If no metadata was previously set, returns null
by default.
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 set_tab_title().
Returns the tooltip text of the tab at index tab_idx
.
Returns true
if the tab at index tab_idx
is disabled.
Returns true
if the tab at index tab_idx
is hidden.
Selects the first available tab with greater index than the currently selected. Returns true
if tab selection changed.
Selects the first available tab with lower index than the currently selected. Returns true
if tab selection changed.
If set on a 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 Popup node.
Sets the button icon from the tab at index tab_idx
.
If disabled
is true
, disables the tab at index tab_idx
, making it non-interactable.
If hidden
is true
, hides the tab at index tab_idx
, making it disappear from the tab area.
Sets an icon for the tab at index tab_idx
.
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 icon_max_width. The height is adjusted according to the icon's ratio.
Sets the metadata value for the tab at index tab_idx
, which can be retrieved later using get_tab_metadata().
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.
Sets a custom tooltip text for tab at index tab_idx
.
Note: By default, if the tooltip
is empty and the tab text is truncated (not all characters fit into the tab), the title will be displayed as a tooltip. To hide the tooltip, assign " "
as the tooltip
text.