diff options
Diffstat (limited to 'scene/gui/tab_container.cpp')
-rw-r--r-- | scene/gui/tab_container.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index d19e5f0d60..5eb579f1d2 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -412,8 +412,9 @@ void TabContainer::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - - call_deferred("set_current_tab",get_current_tab()); //wait until all changed theme + if (get_tab_count() > 0) { + call_deferred("set_current_tab",get_current_tab()); //wait until all changed theme + } } break; } } @@ -704,13 +705,13 @@ Size2 TabContainer::get_minimum_size() const { if (c->is_set_as_toplevel()) continue; - if (!c->has_meta("_tab_name")) - continue; + //if (!c->has_meta("_tab_name")) + // continue; if (!c->is_visible()) continue; - Size2 cms = c->get_minimum_size(); + Size2 cms = c->get_combined_minimum_size(); ms.x=MAX(ms.x,cms.x); ms.y=MAX(ms.y,cms.y); } @@ -722,6 +723,9 @@ Size2 TabContainer::get_minimum_size() const { ms.y+=MAX(tab_bg->get_minimum_size().y,tab_fg->get_minimum_size().y); ms.y+=font->get_height(); + Ref<StyleBox> sb = get_stylebox("panel"); + ms+=sb->get_minimum_size(); + return ms; } |