From b8ce726dd0bbd0a6cf3f6088b5fec252c92b45fd Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Thu, 31 Mar 2022 16:34:27 -0300 Subject: Small fixes for `TabContainer` --- scene/gui/tab_container.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 1697e743be..05f1ee3dad 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -209,7 +209,7 @@ void TabContainer::_on_theme_changed() { tab_bar->add_theme_color_override(SNAME("font_outline_color"), get_theme_color(SNAME("font_outline_color"))); tab_bar->add_theme_font_override(SNAME("font"), get_theme_font(SNAME("font"))); tab_bar->add_theme_constant_override(SNAME("font_size"), get_theme_constant(SNAME("font_size"))); - tab_bar->add_theme_constant_override(SNAME("icon_separation"), get_theme_constant(SNAME("icon_separation"))); + tab_bar->add_theme_constant_override(SNAME("hseparation"), get_theme_constant(SNAME("icon_separation"))); tab_bar->add_theme_constant_override(SNAME("outline_size"), get_theme_constant(SNAME("outline_size"))); _update_margins(); @@ -497,6 +497,9 @@ void TabContainer::add_child_notify(Node *p_child) { tab_bar->add_tab(p_child->get_name()); _update_margins(); + if (get_tab_count() == 1) { + update(); + } p_child->connect("renamed", callable_mp(this, &TabContainer::_refresh_tab_names)); @@ -545,6 +548,9 @@ void TabContainer::remove_child_notify(Node *p_child) { tab_bar->remove_tab(get_tab_idx_from_control(c)); _update_margins(); + if (get_tab_count() == 0) { + update(); + } if (p_child->has_meta("_tab_name")) { p_child->remove_meta("_tab_name"); -- cgit v1.2.3