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

Fix TabContainer tab offset moving when not needed #97209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions scene/gui/tab_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,14 @@ void TabContainer::_repaint() {
Vector<Control *> controls = _get_tab_controls();
int current = get_current_tab();

// Move the TabBar to the top or bottom.
// Don't change the left and right offsets since the TabBar will resize and may change tab offset.
if (tabs_position == POSITION_BOTTOM) {
tab_bar->set_anchors_and_offsets_preset(PRESET_BOTTOM_WIDE);
tab_bar->set_anchor_and_offset(SIDE_BOTTOM, 1.0, 0.0);
tab_bar->set_anchor_and_offset(SIDE_TOP, 1.0, -_get_tab_height());
} else {
tab_bar->set_anchors_and_offsets_preset(PRESET_TOP_WIDE);
tab_bar->set_anchor_and_offset(SIDE_BOTTOM, 0.0, _get_tab_height());
tab_bar->set_anchor_and_offset(SIDE_TOP, 0.0, 0.0);
}

updating_visibility = true;
Expand Down Expand Up @@ -299,7 +303,6 @@ void TabContainer::_repaint() {
}
updating_visibility = false;

_update_margins();
update_minimum_size();
}

Expand Down
Loading