A control that provides a horizontal bar with tabs. Similar to TabContainer but is only in charge of drawing tabs, not interacting with children.
Emitted when the active tab is rearranged via mouse drag. See drag_to_rearrange_enabled.
Emitted when a tab's right button is pressed. See 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.
Note: Tabs are not removed automatically once the close button is pressed, this behavior needs to be programmed manually. For example:
Emitted when a tab is hovered by the mouse.
Emitted when a tab is right-clicked. select_with_rmb must be enabled.
Emitted when a tab is selected via click, directional input, or script, even if it is the current tab.
ALIGNMENT_LEFT = 0
Places tabs to the left.
ALIGNMENT_CENTER = 1
Places tabs in the middle.
ALIGNMENT_RIGHT = 2
Places tabs to the right.
ALIGNMENT_MAX = 3
Represents the size of the AlignmentMode enum.
CLOSE_BUTTON_SHOW_NEVER = 0
Never show the close buttons.
CLOSE_BUTTON_SHOW_ACTIVE_ONLY = 1
Only show the close button on the currently active tab.
CLOSE_BUTTON_SHOW_ALWAYS = 2
Show the close button on all tabs.
CLOSE_BUTTON_MAX = 3
Represents the size of the CloseButtonDisplayPolicy enum.
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 index of the current selected tab. A value of -1
means that no tab is selected and can only be set when deselect_enabled is true
or if all tabs are hidden or disabled.
If true
, all tabs can be deselected so that no tab is selected. Click on the current tab to deselect it.
If true
, tabs can be rearranged with mouse drag.
Sets the maximum width which all tabs should be limited to. Unlimited if set to 0
.
If true
, the tab offset will be changed to keep the currently selected tab visible.
if true
, the mouse's scroll wheel can be used to navigate the scroll view.
If true
, enables selecting a tab with the right mouse button.
Sets the position at which tabs will be placed. See AlignmentMode for details.
Sets when the close button will appear on the tabs. See CloseButtonDisplayPolicy for details.
The number of tabs currently in the bar.
TabBars 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 TabBars.
Adds a new tab.
Clears all tabs.
Moves the scroll view to make the tab visible.
Returns true
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 tab_idx
or null
if the right button has no icon.
Returns the icon for the tab at index tab_idx
or null
if the tab has no icon.
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 tab title language code.
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 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 tab_idx
.
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.
Moves a tab from from
to to
.
Removes the tab at index tab_idx
.
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.
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 tab_button_pressed). Giving it a null
value will hide the button.
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 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 tab_idx
, which can be retrieved later using get_tab_metadata().
Sets tab title base writing direction.
Sets a title
for the tab at index tab_idx
.
Sets a tooltip
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.