Skip to content

Commit

Permalink
Update FoldableContainer docs and fix sorting.
Browse files Browse the repository at this point in the history
  • Loading branch information
WhalesState committed Jan 26, 2025
1 parent e43203d commit 55e41ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions doc/classes/FoldableContainer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<methods>
<method name="add_button">
<return type="void" />
<param index="0" name="icon" type="Texture2D" />
<param index="0" name="icon" type="Texture2D" default="null" />
<param index="1" name="position" type="int" default="-1" />
<param index="2" name="id" type="int" default="-1" />
<description>
Expand All @@ -25,7 +25,7 @@
<method name="clear">
<return type="void" />
<description>
Remove all the container buttons.
Remove all the title buttons.
</description>
</method>
<method name="expand">
Expand Down Expand Up @@ -228,6 +228,7 @@
</methods>
<members>
<member name="button_count" type="int" setter="set_button_count" getter="get_button_count" default="0">
The title buttons count, changing this will change the buttons array size which can add/remove buttons automatically.
</member>
<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" overrides="Control" enum="Control.FocusMode" default="2" />
<member name="foldable_group" type="FoldableGroup" setter="set_foldable_group" getter="get_foldable_group">
Expand Down Expand Up @@ -273,7 +274,7 @@
<signal name="folding_changed">
<param index="0" name="is_folded" type="bool" />
<description>
Emitted when the container is expanded/collapsed.
Emitted when the container is folded/expanded.
</description>
</signal>
</signals>
Expand Down
3 changes: 2 additions & 1 deletion scene/gui/foldable_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ void FoldableContainer::set_title_position(FoldableContainer::TitlePosition p_ti
if (title_position != p_title_position) {
title_position = p_title_position;
queue_redraw();
queue_sort();
}
}

Expand Down Expand Up @@ -835,7 +836,7 @@ void FoldableContainer::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_text_overrun_behavior"), &FoldableContainer::get_text_overrun_behavior);
ClassDB::bind_method(D_METHOD("set_title_position", "title_position"), &FoldableContainer::set_title_position);
ClassDB::bind_method(D_METHOD("get_title_position"), &FoldableContainer::get_title_position);
ClassDB::bind_method(D_METHOD("add_button", "icon", "position", "id"), &FoldableContainer::add_button, DEFVAL(-1), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("add_button", "icon", "position", "id"), &FoldableContainer::add_button, DEFVAL(Ref<Texture2D>()), DEFVAL(-1), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("remove_button", "index"), &FoldableContainer::remove_button);
ClassDB::bind_method(D_METHOD("set_button_count", "count"), &FoldableContainer::set_button_count);
ClassDB::bind_method(D_METHOD("get_button_count"), &FoldableContainer::get_button_count);
Expand Down

0 comments on commit 55e41ff

Please sign in to comment.