Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TabContainer Fix moving dropped tab to incorrect child index #51177

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scene/gui/tab_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ void TabContainer::drop_data(const Point2 &p_point, const Variant &p_data) {
if (hover_now < 0) {
hover_now = get_tab_count() - 1;
}
move_child(get_tab_control(tab_from_id), hover_now);
move_child(get_tab_control(tab_from_id), get_tab_control(hover_now)->get_index());
set_current_tab(hover_now);
} else if (get_tabs_rearrange_group() != -1) {
// drag and drop between TabContainers
Expand All @@ -912,7 +912,7 @@ void TabContainer::drop_data(const Point2 &p_point, const Variant &p_data) {
if (hover_now < 0) {
hover_now = get_tab_count() - 1;
}
move_child(moving_tabc, hover_now);
move_child(moving_tabc, get_tab_control(hover_now)->get_index());
set_current_tab(hover_now);
emit_signal(SNAME("tab_changed"), hover_now);
}
Expand Down