浏览代码

Merge pull request #46674 from cmd410/fix-tab-container

Fix TabContainer _get_tab_width for localized node names
Rémi Verschelde 4 年之前
父节点
当前提交
888051889e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/tab_container.cpp

+ 1 - 1
scene/gui/tab_container.cpp

@@ -645,7 +645,7 @@ int TabContainer::_get_tab_width(int p_index) const {
 	// Get the width of the text displayed on the tab.
 	// Get the width of the text displayed on the tab.
 	Ref<Font> font = get_theme_font("font");
 	Ref<Font> font = get_theme_font("font");
 	int font_size = get_theme_font_size("font_size");
 	int font_size = get_theme_font_size("font_size");
-	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, font_size).width;
 	int width = font->get_string_size(text, font_size).width;
 
 
 	// Add space for a tab icon.
 	// Add space for a tab icon.