Browse Source

Fix TabContainer _get_tab_width

Now it translates node name before calculating tab width

(cherry picked from commit 89baf02fb60b649a96bc49d19252be39808e3ba1)
Crystal Melting Dot 4 years ago
parent
commit
0eb0e6128c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/gui/tab_container.cpp

+ 1 - 1
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> 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.