A control that provides a horizontal bar with tabs.
A control that provides a horizontal bar with tabs. Similar to [TabContainer] but is only in charge of drawing tabs, not interacting with children.
Adds a new tab.
Clears all tabs.
Moves the scroll view to make the tab visible.
Returns [code]true[/code] if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible.
Returns the previously active tab index.
Returns the icon for the right button of the tab at index [param tab_idx] or [code]null[/code] if the right button has no icon.
Returns the icon for the tab at index [param tab_idx] or [code]null[/code] if the tab has no icon.
Returns the maximum allowed width of the icon for the tab at index [param tab_idx].
Returns the index of the tab at local coordinates [param point]. Returns [code]-1[/code] if the point is outside the control boundaries or if there's no tab at the queried position.
Returns tab title language code.
Returns the metadata value set to the tab at index [param tab_idx] using [method set_tab_metadata]. If no metadata was previously set, returns [code]null[/code] by default.
Returns the number of hidden tabs offsetted to the left.
Returns tab [Rect2] with local position and size.
Returns tab title text base writing direction.
Returns the title of the tab at index [param tab_idx].
Returns [code]true[/code] if the tab at index [param tab_idx] is disabled.
Returns [code]true[/code] if the tab at index [param tab_idx] is hidden.
Moves a tab from [param from] to [param to].
Removes the tab at index [param tab_idx].
Selects the first available tab with greater index than the currently selected. Returns [code]true[/code] if tab selection changed.
Selects the first available tab with lower index than the currently selected. Returns [code]true[/code] if tab selection changed.
Sets an [param icon] for the button of the tab at index [param tab_idx] (located to the right, before the close button), making it visible and clickable (See [signal tab_button_pressed]). Giving it a [code]null[/code] value will hide the button.
If [param disabled] is [code]true[/code], disables the tab at index [param tab_idx], making it non-interactable.
If [param hidden] is [code]true[/code], hides the tab at index [param tab_idx], making it disappear from the tab area.
Sets an [param icon] for the tab at index [param tab_idx].
Sets the maximum allowed width of the icon for the tab at index [param tab_idx]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio.
Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
Sets the metadata value for the tab at index [param tab_idx], which can be retrieved later using [method get_tab_metadata].
Sets tab title base writing direction.
Sets a [param title] for the tab at index [param tab_idx].
If [code]true[/code], 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.
Select tab at index [code]tab_idx[/code].
If [code]true[/code], tabs can be rearranged with mouse drag.
Sets the maximum width which all tabs should be limited to. Unlimited if set to [code]0[/code].
If [code]true[/code], the tab offset will be changed to keep the currently selected tab visible.
if [code]true[/code], the mouse's scroll wheel can be used to navigate the scroll view.
If [code]true[/code], enables selecting a tab with the right mouse button.
Sets the position at which tabs will be placed. See [enum AlignmentMode] for details.
Sets when the close button will appear on the tabs. See [enum CloseButtonDisplayPolicy] for details.
The number of tabs currently in the bar.
[TabBar]s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with [member drag_to_rearrange_enabled].
Setting this to [code]-1[/code] will disable rearranging between [TabBar]s.
Emitted when the active tab is rearranged via mouse drag. See [member drag_to_rearrange_enabled].
Emitted when a tab's right button is pressed. See [method set_tab_button_icon].
Emitted when switching to another tab.
Emitted when a tab is clicked, even if it is the current tab.
Emitted when a tab's close button is pressed.
[b]Note:[/b] Tabs are not removed automatically once the close button is pressed, this behavior needs to be programmed manually. For example:
[codeblocks]
[gdscript]
$TabBar.tab_close_pressed.connect($TabBar.remove_tab)
[/gdscript]
[csharp]
GetNode<TabBar>("TabBar").TabClosePressed += GetNode<TabBar>("TabBar").RemoveTab;
[/csharp]
[/codeblocks]
Emitted when a tab is hovered by the mouse.
Emitted when a tab is right-clicked. [member select_with_rmb] must be enabled.
Emitted when a tab is selected via click or script, even if it is the current tab.
Places tabs to the left.
Places tabs in the middle.
Places tabs to the right.
Represents the size of the [enum AlignmentMode] enum.
Never show the close buttons.
Only show the close button on the currently active tab.
Show the close button on all tabs.
Represents the size of the [enum CloseButtonDisplayPolicy] enum.
Modulation color for the [theme_item drop_mark] icon.
Font color of disabled tabs.
Font color of the currently hovered tab. Does not apply to the selected tab.
The tint of text outline of the tab name.
Font color of the currently selected tab.
Font color of the other, unselected tabs.
The horizontal separation between the elements inside tabs.
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 [method set_tab_icon_max_width]. The height is adjusted according to the icon's ratio.
The size of the tab text outline.
[b]Note:[/b] If using a font with [member FontFile.multichannel_signed_distance_field] enabled, its [member FontFile.msdf_pixel_range] must be set to at least [i]twice[/i] the value of [theme_item outline_size] for outline rendering to look correct. Otherwise, the outline may appear to be cut off earlier than intended.
The font used to draw tab names.
Font size of the tab names.
The icon for the close button (see [member tab_close_display_policy]).
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.
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.
Icon shown to indicate where a dragged tab is gonna be dropped (see [member drag_to_rearrange_enabled]).
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.
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.
Background of the tab and close buttons when they're being hovered with the cursor.
Background of the tab and close buttons when it's being pressed.
The style of disabled tabs.
[StyleBox] used when the [TabBar] is focused. The [theme_item tab_focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox] of the selected tab, so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons.
The style of the currently hovered tab. Does not apply to the selected tab.
[b]Note:[/b] This style will be drawn with the same width as [theme_item tab_unselected] at minimum.
The style of the currently selected tab.
The style of the other, unselected tabs.