diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 3c1faa434ef..764a9c7d5f9 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -6,8 +6,6 @@ Sets the active tab's [code]visible[/code] property to the value [code]true[/code]. Sets all other children's to [code]false[/code]. Ignores non-[Control] children. - Individual tabs are always visible unless you use [method set_tab_disabled] and [method set_tab_title] to hide it. - To hide only a tab's content, nest the content inside a child [Control], so it receives the [TabContainer]'s visibility setting instead. @@ -50,6 +48,13 @@ Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is disabled. + + + + + Returns [code]true[/code] if the tab at index [code]tab_idx[/code] is hidden. + + @@ -89,8 +94,15 @@ - If [code]disabled[/code] is [code]false[/code], hides the tab at index [code]tab_idx[/code]. - [b]Note:[/b] Its title text will remain, unless also removed with [method set_tab_title]. + If [code]disabled[/code] is [code]true[/code], disables the tab at index [code]tab_idx[/code], making it non-interactable. + + + + + + + + If [code]hidden[/code] is [code]true[/code], hides the tab at index [code]tab_idx[/code], making it disappear from the tab area. @@ -106,14 +118,14 @@ - Sets a title for the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title]. + Sets a title for the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node. - Defines rearrange group id, choose for each [TabContainer] the same value to enable tab drag between [TabContainer]. Enable drag with [code]set_drag_to_rearrange_enabled(true)[/code]. + Defines rearrange group id, choose for each [TabContainer] the same value to enable tab drag between [TabContainer]. Enable drag with [member drag_to_rearrange_enabled]. diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index 37ec7d82694..a61fa777cd3 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -79,7 +79,7 @@ - Returns the title of the tab at index [code]tab_idx[/code]. Tab titles default to the name of the indexed child node, but this can be overridden with [method set_tab_title]. + Returns the title of the tab at index [code]tab_idx[/code]. @@ -115,8 +115,7 @@ - If [code]disabled[/code] is [code]false[/code], hides the tab at index [code]tab_idx[/code]. - [b]Note:[/b] Its title text will remain unless it is also removed with [method set_tab_title]. + If [code]disabled[/code] is [code]true[/code], disables the tab at index [code]tab_idx[/code], making it non-interactable. @@ -139,7 +138,7 @@ - Defines the rearrange group ID. Choose for each [Tabs] the same value to dragging tabs between [Tabs]. Enable drag with [code]set_drag_to_rearrange_enabled(true)[/code]. + Defines the rearrange group ID. Choose for each [Tabs] the same value to dragging tabs between [Tabs]. Enable drag with [member drag_to_rearrange_enabled]. diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index a20806dac3c..b3ddb2f19ba 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -1055,6 +1055,8 @@ void TabContainer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tab_icon", "tab_idx"), &TabContainer::get_tab_icon); ClassDB::bind_method(D_METHOD("set_tab_disabled", "tab_idx", "disabled"), &TabContainer::set_tab_disabled); ClassDB::bind_method(D_METHOD("get_tab_disabled", "tab_idx"), &TabContainer::get_tab_disabled); + ClassDB::bind_method(D_METHOD("set_tab_hidden", "tab_idx", "hidden"), &TabContainer::set_tab_hidden); + ClassDB::bind_method(D_METHOD("get_tab_hidden", "tab_idx"), &TabContainer::get_tab_hidden); ClassDB::bind_method(D_METHOD("get_tab_idx_at_point", "point"), &TabContainer::get_tab_idx_at_point); ClassDB::bind_method(D_METHOD("set_popup", "popup"), &TabContainer::set_popup); ClassDB::bind_method(D_METHOD("get_popup"), &TabContainer::get_popup);