Fix regressions with nameless and icon-only tabs

This commit is contained in:
Michael Alexsander
2022-03-06 22:17:35 -03:00
parent 272b355954
commit c0381594c3
3 changed files with 6 additions and 7 deletions

View File

@ -635,14 +635,13 @@ void TabContainer::set_tab_title(int p_tab, const String &p_title) {
Control *child = get_tab_control(p_tab);
ERR_FAIL_COND(!child);
if (p_title.is_empty()) {
tab_bar->set_tab_title(p_tab, String(child->get_name()));
tab_bar->set_tab_title(p_tab, p_title);
if (p_title == child->get_name()) {
if (child->has_meta("_tab_name")) {
child->remove_meta("_tab_name");
}
} else {
tab_bar->set_tab_title(p_tab, p_title);
child->set_meta("_tab_name", p_title);
}