From 5d1697b78f868b2168eca403283bb7aaa5837242 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Sun, 5 May 2019 13:50:37 -0300 Subject: [PATCH] Fix 'TabContainer' not updating its tab titles when locale is changed (cherry picked from commit a242bf464a1d79291f5d529276b2c1efddf5359a) --- scene/gui/tab_container.cpp | 6 +++++- scene/gui/tabs.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index e78990c8436..b2b50e99bb0 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -143,6 +143,11 @@ void TabContainer::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + + minimum_size_changed(); + update(); + } break; case NOTIFICATION_RESIZED: { Vector tabs = _get_tabs(); @@ -178,7 +183,6 @@ void TabContainer::_notification(int p_what) { first_tab_cache--; } } break; - case NOTIFICATION_DRAW: { RID canvas = get_canvas_item(); diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index ac643c1320e..36571cc8788 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -222,6 +222,10 @@ void Tabs::_notification(int p_what) { switch (p_what) { + case NOTIFICATION_TRANSLATION_CHANGED: { + minimum_size_changed(); + update(); + } break; case NOTIFICATION_MOUSE_EXIT: { rb_hover = -1; cb_hover = -1; @@ -232,7 +236,6 @@ void Tabs::_notification(int p_what) { _update_cache(); _ensure_no_over_offset(); ensure_tab_visible(current); - } break; case NOTIFICATION_DRAW: { _update_cache(); @@ -394,7 +397,6 @@ void Tabs::_notification(int p_what) { } else { buttons_visible = false; } - } break; } }