Signal6
Signal support.
TabBar.swift:2009class Signal6
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (62) members.
Types
enum AlignmentMode
enum CloseButtonDisplayPolicy
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
class Signal4
Signal support.
class Signal5
Signal support.
class Signal7
Signal support.
class Signal8
Signal support.
Type members
Instance members
var activeTabRearranged: Signal8
Emitted when the active tab is rearranged via mouse drag. See
dragToRearrangeEnabled
.var clipTabs: Bool
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.var currentTab: Int32
The index of the current selected tab. A value of
-1
means that no tab is selected and can only be set whendeselectEnabled
istrue
or if all tabs are hidden or disabled.var deselectEnabled: Bool
If
true
, all tabs can be deselected so that no tab is selected. Click on the current tab to deselect it.var dragToRearrangeEnabled: Bool
If
true
, tabs can be rearranged with mouse drag.var maxTabWidth: Int32
Sets the maximum width which all tabs should be limited to. Unlimited if set to
0
.var scrollToSelected: Bool
If
true
, the tab offset will be changed to keep the currently selected tab visible.var scrollingEnabled: Bool
if
true
, the mouse’s scroll wheel can be used to navigate the scroll view.var selectWithRmb: Bool
If
true
, enables selecting a tab with the right mouse button.var tabAlignment: TabBar.AlignmentMode
Sets the position at which tabs will be placed. See
AlignmentMode
for details.var tabButtonPressed: Signal6
Emitted when a tab’s right button is pressed. See
setTabButtonIcon(tabIdx:icon:)
.var tabChanged: Signal2
Emitted when switching to another tab.
var tabClicked: Signal3
Emitted when a tab is clicked, even if it is the current tab.
var tabCloseDisplayPolicy: TabBar.CloseButtonDisplayPolicy
Sets when the close button will appear on the tabs. See
CloseButtonDisplayPolicy
for details.var tabClosePressed: Signal5
Emitted when a tab’s close button is pressed.
var tabCount: Int32
The number of tabs currently in the bar.
var tabHovered: Signal7
Emitted when a tab is hovered by the mouse.
var tabRmbClicked: Signal4
Emitted when a tab is right-clicked.
selectWithRmb
must be enabled.var tabSelected: Signal1
Emitted when a tab is selected via click, directional input, or script, even if it is the current tab.
var tabsRearrangeGroup: Int32
TabBar
s with the same rearrange group ID will allow dragging the tabs between them. Enable drag withdragToRearrangeEnabled
.func addTab(title: String, icon: Texture2D?
) Adds a new tab.
func clearTabs(
) Clears all tabs.
func ensureTabVisible(idx: Int32
) Moves the scroll view to make the tab visible.
func getOffsetButtonsVisible(
) -> Bool Returns
true
if the offset buttons (the ones that appear when there’s not enough space for all tabs) are visible.func getPreviousTab(
) -> Int32 Returns the previously active tab index.
func getTabButtonIcon(tabIdx: Int32
) -> Texture2D? Returns the icon for the right button of the tab at index
tabIdx
ornull
if the right button has no icon.func getTabIcon(tabIdx: Int32
) -> Texture2D? Returns the icon for the tab at index
tabIdx
ornull
if the tab has no icon.func getTabIconMaxWidth(tabIdx: Int32
) -> Int32 Returns the maximum allowed width of the icon for the tab at index
tabIdx
.func getTabIdxAtPoint(Vector2
) -> Int32 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.func getTabLanguage(tabIdx: Int32
) -> String Returns tab title language code.
func getTabMetadata(tabIdx: Int32
) -> Variant Returns the metadata value set to the tab at index
tabIdx
usingsetTabMetadata(tabIdx:metadata:)
. If no metadata was previously set, returnsnull
by default.func getTabOffset(
) -> Int32 Returns the number of hidden tabs offsetted to the left.
func getTabRect(tabIdx: Int32
) -> Rect2 Returns tab
Rect2
with local position and size.func getTabTextDirection(tabIdx: Int32
) -> Control.TextDirection Returns tab title text base writing direction.
func getTabTitle(tabIdx: Int32
) -> String Returns the title of the tab at index
tabIdx
.func getTabTooltip(tabIdx: Int32
) -> String Returns the tooltip text of the tab at index
tabIdx
.func isTabDisabled(tabIdx: Int32
) -> Bool Returns
true
if the tab at indextabIdx
is disabled.func isTabHidden(tabIdx: Int32
) -> Bool Returns
true
if the tab at indextabIdx
is hidden.func moveTab(from: Int32, to: Int32
) Moves a tab from
from
toto
.func removeTab(tabIdx: Int32
) Removes the tab at index
tabIdx
.func selectNextAvailable(
) -> Bool Selects the first available tab with greater index than the currently selected. Returns
true
if tab selection changed.func selectPreviousAvailable(
) -> Bool Selects the first available tab with lower index than the currently selected. Returns
true
if tab selection changed.func setTabButtonIcon(tabIdx: Int32, icon: Texture2D?
) Sets an
icon
for the button of the tab at indextabIdx
(located to the right, before the close button), making it visible and clickable (See [signal tab_button_pressed]). Giving it anull
value will hide the button.func setTabDisabled(tabIdx: Int32, disabled: Bool
) If
disabled
istrue
, disables the tab at indextabIdx
, making it non-interactable.func setTabIcon(tabIdx: Int32, icon: Texture2D?
) Sets an
icon
for the tab at indextabIdx
.func setTabIconMaxWidth(tabIdx: Int32, width: Int32
) Sets the maximum allowed width of the icon for the tab at index
tabIdx
. 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.func setTabLanguage(tabIdx: Int32, language: String
) Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
func setTabMetadata(tabIdx: Int32, metadata: Variant
) Sets the metadata value for the tab at index
tabIdx
, which can be retrieved later usinggetTabMetadata(tabIdx:)
.func setTabTextDirection(tabIdx: Int32, direction: Control.TextDirection
) Sets tab title base writing direction.
func setTabTitle(tabIdx: Int32, title: String
) Sets a
title
for the tab at indextabIdx
.func setTabTooltip(tabIdx: Int32, tooltip: String
) Sets a
tooltip
for tab at indextabIdx
.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ tab: Int64) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)