summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-31 22:28:13 +0200
committerGitHub <noreply@github.com>2022-03-31 22:28:13 +0200
commitaf7a4c46723748de916913ac641c02218ed43549 (patch)
treee99bbfef9f7a78b491b72abd5ec4bf902b45c40c /scene/gui
parent8e5d927af5a27759f831930be47a1bc5fc5dea05 (diff)
parentb8ce726dd0bbd0a6cf3f6088b5fec252c92b45fd (diff)
Merge pull request #59762 from YeldhamDev/tabc_fixes
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tab_container.cpp8
1 files changed, 7 insertions, 1 deletions
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");