From 0eb0e6128c4f438c150a27a1c0925c777d547bc4 Mon Sep 17 00:00:00 2001 From: Crystal Melting Dot Date: Thu, 4 Mar 2021 22:10:28 +0300 Subject: [PATCH] Fix TabContainer _get_tab_width Now it translates node name before calculating tab width (cherry picked from commit 89baf02fb60b649a96bc49d19252be39808e3ba1) --- scene/gui/tab_container.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 673641c0446..d3b61a22748 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -506,7 +506,7 @@ int TabContainer::_get_tab_width(int p_index) const { // Get the width of the text displayed on the tab. Ref font = get_font("font"); - String text = control->has_meta("_tab_name") ? String(tr(String(control->get_meta("_tab_name")))) : String(control->get_name()); + String text = control->has_meta("_tab_name") ? String(tr(String(control->get_meta("_tab_name")))) : String(tr(control->get_name())); int width = font->get_string_size(text).width; // Add space for a tab icon.