summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/create_dialog.cpp1
-rw-r--r--editor/dependency_editor.cpp1
-rw-r--r--editor/editor_about.cpp1
-rw-r--r--editor/editor_layouts_dialog.cpp1
-rw-r--r--editor/export/project_export.cpp1
-rw-r--r--editor/gui/editor_file_dialog.cpp3
-rw-r--r--editor/history_dock.cpp1
-rw-r--r--editor/plugins/script_editor_plugin.cpp3
-rw-r--r--editor/plugins/shader_editor_plugin.cpp1
-rw-r--r--editor/plugins/shader_file_editor_plugin.cpp1
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp1
-rw-r--r--editor/plugins/theme_editor_plugin.cpp1
-rw-r--r--editor/plugins/tiles/atlas_merging_dialog.cpp1
-rw-r--r--editor/plugins/tiles/tile_map_editor.cpp4
-rw-r--r--editor/plugins/tiles/tile_proxies_manager_dialog.cpp3
-rw-r--r--editor/plugins/tiles/tile_set_editor.cpp2
-rw-r--r--editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp1
-rw-r--r--modules/gridmap/editor/grid_map_editor_plugin.cpp1
-rw-r--r--scene/gui/item_list.cpp13
-rw-r--r--scene/gui/item_list.h1
20 files changed, 40 insertions, 2 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp
index e37035f5eb..c4ca90d1e1 100644
--- a/editor/create_dialog.cpp
+++ b/editor/create_dialog.cpp
@@ -794,6 +794,7 @@ CreateDialog::CreateDialog() {
rec_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL);
recent = memnew(ItemList);
+ recent->set_auto_translate(false);
rec_vb->add_margin_child(TTR("Recent:"), recent, true);
recent->set_allow_reselect(true);
recent->connect("item_selected", callable_mp(this, &CreateDialog::_history_selected));
diff --git a/editor/dependency_editor.cpp b/editor/dependency_editor.cpp
index 26779f5b52..a891491339 100644
--- a/editor/dependency_editor.cpp
+++ b/editor/dependency_editor.cpp
@@ -398,6 +398,7 @@ DependencyEditorOwners::DependencyEditorOwners() {
file_options->connect("id_pressed", callable_mp(this, &DependencyEditorOwners::_file_option));
owners = memnew(ItemList);
+ owners->set_auto_translate(false);
owners->set_select_mode(ItemList::SELECT_MULTI);
owners->connect("item_clicked", callable_mp(this, &DependencyEditorOwners::_list_rmb_clicked));
owners->connect("item_activated", callable_mp(this, &DependencyEditorOwners::_select_file));
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index 672697bab0..1f9911f31e 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -99,6 +99,7 @@ ScrollContainer *EditorAbout::_populate_list(const String &p_name, const List<St
vbc->add_child(lbl);
ItemList *il = memnew(ItemList);
+ il->set_auto_translate(false);
il->set_h_size_flags(Control::SIZE_EXPAND_FILL);
il->set_same_column_width(true);
il->set_auto_height(true);
diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp
index dce61f66d3..c6f518d4c1 100644
--- a/editor/editor_layouts_dialog.cpp
+++ b/editor/editor_layouts_dialog.cpp
@@ -114,6 +114,7 @@ EditorLayoutsDialog::EditorLayoutsDialog() {
add_child(makevb);
layout_names = memnew(ItemList);
+ layout_names->set_auto_translate(false);
layout_names->set_auto_height(true);
layout_names->set_custom_minimum_size(Size2(300 * EDSCALE, 50 * EDSCALE));
layout_names->set_visible(true);
diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp
index f2c5eeb2ed..5d84e4f78f 100644
--- a/editor/export/project_export.cpp
+++ b/editor/export/project_export.cpp
@@ -1191,6 +1191,7 @@ ProjectExportDialog::ProjectExportDialog() {
preset_vb->add_child(mc);
mc->set_v_size_flags(Control::SIZE_EXPAND_FILL);
presets = memnew(ItemList);
+ presets->set_auto_translate(false);
SET_DRAG_FORWARDING_GCD(presets, ProjectExportDialog);
mc->add_child(presets);
presets->connect("item_selected", callable_mp(this, &ProjectExportDialog::_edit_preset));
diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp
index fad7e29be7..9764574d04 100644
--- a/editor/gui/editor_file_dialog.cpp
+++ b/editor/gui/editor_file_dialog.cpp
@@ -1909,6 +1909,7 @@ EditorFileDialog::EditorFileDialog() {
fav_down->connect("pressed", callable_mp(this, &EditorFileDialog::_favorite_move_down));
favorites = memnew(ItemList);
+ favorites->set_auto_translate(false);
fav_vb->add_child(favorites);
favorites->set_v_size_flags(Control::SIZE_EXPAND_FILL);
favorites->connect("item_selected", callable_mp(this, &EditorFileDialog::_favorite_selected));
@@ -1918,6 +1919,7 @@ EditorFileDialog::EditorFileDialog() {
rec_vb->set_custom_minimum_size(Size2(150, 100) * EDSCALE);
rec_vb->set_v_size_flags(Control::SIZE_EXPAND_FILL);
recent = memnew(ItemList);
+ recent->set_auto_translate(false);
recent->set_allow_reselect(true);
rec_vb->add_margin_child(TTR("Recent:"), recent, true);
recent->connect("item_selected", callable_mp(this, &EditorFileDialog::_recent_selected));
@@ -1941,6 +1943,7 @@ EditorFileDialog::EditorFileDialog() {
// Item (files and folders) list with context menu.
item_list = memnew(ItemList);
+ item_list->set_auto_translate(false);
item_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
item_list->connect("item_clicked", callable_mp(this, &EditorFileDialog::_item_list_item_rmb_clicked));
item_list->connect("empty_clicked", callable_mp(this, &EditorFileDialog::_item_list_empty_clicked));
diff --git a/editor/history_dock.cpp b/editor/history_dock.cpp
index 0ec840b8f1..6ec240fdf0 100644
--- a/editor/history_dock.cpp
+++ b/editor/history_dock.cpp
@@ -248,6 +248,7 @@ HistoryDock::HistoryDock() {
global_history_checkbox->connect("toggled", callable_mp(this, &HistoryDock::refresh_history).unbind(1));
action_list = memnew(ItemList);
+ action_list->set_auto_translate(false);
add_child(action_list);
action_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
action_list->connect("item_selected", callable_mp(this, &HistoryDock::seek_history));
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 3fe6bd8a4b..edf0b73356 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -3860,6 +3860,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
scripts_vbox->add_child(filter_scripts);
script_list = memnew(ItemList);
+ script_list->set_auto_translate(false);
scripts_vbox->add_child(script_list);
script_list->set_custom_minimum_size(Size2(150, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
script_list->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -3904,6 +3905,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
overview_vbox->add_child(filter_methods);
members_overview = memnew(ItemList);
+ members_overview->set_auto_translate(false);
overview_vbox->add_child(members_overview);
members_overview->set_allow_reselect(true);
@@ -3912,6 +3914,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
members_overview->set_allow_rmb_select(true);
help_overview = memnew(ItemList);
+ help_overview->set_auto_translate(false);
overview_vbox->add_child(help_overview);
help_overview->set_allow_reselect(true);
help_overview->set_custom_minimum_size(Size2(0, 60) * EDSCALE); //need to give a bit of limit to avoid it from disappearing
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index 315c71631a..5ee4d4a961 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -657,6 +657,7 @@ ShaderEditorPlugin::ShaderEditorPlugin() {
}
shader_list = memnew(ItemList);
+ shader_list->set_auto_translate(false);
shader_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
vb->add_child(shader_list);
shader_list->connect("item_selected", callable_mp(this, &ShaderEditorPlugin::_shader_selected));
diff --git a/editor/plugins/shader_file_editor_plugin.cpp b/editor/plugins/shader_file_editor_plugin.cpp
index 11bec4f61c..d68b3bde14 100644
--- a/editor/plugins/shader_file_editor_plugin.cpp
+++ b/editor/plugins/shader_file_editor_plugin.cpp
@@ -256,6 +256,7 @@ ShaderFileEditor::ShaderFileEditor() {
add_child(main_hs);
versions = memnew(ItemList);
+ versions->set_auto_translate(false);
versions->connect("item_selected", callable_mp(this, &ShaderFileEditor::_version_selected));
versions->set_custom_minimum_size(Size2i(200 * EDSCALE, 0));
main_hs->add_child(versions);
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index b5ccf907c9..f4fa4b14bb 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -1880,6 +1880,7 @@ SpriteFramesEditor::SpriteFramesEditor() {
add_child(file);
frame_list = memnew(ItemList);
+ frame_list->set_auto_translate(false);
frame_list->set_v_size_flags(SIZE_EXPAND_FILL);
frame_list->set_icon_mode(ItemList::ICON_MODE_TOP);
frame_list->set_texture_filter(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS);
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp
index 6c153f6113..bd66e5e9b7 100644
--- a/editor/plugins/theme_editor_plugin.cpp
+++ b/editor/plugins/theme_editor_plugin.cpp
@@ -2247,6 +2247,7 @@ ThemeTypeDialog::ThemeTypeDialog() {
add_type_vb->add_child(add_type_options_label);
add_type_options = memnew(ItemList);
+ add_type_options->set_auto_translate(false);
add_type_options->set_v_size_flags(Control::SIZE_EXPAND_FILL);
add_type_vb->add_child(add_type_options);
add_type_options->connect("item_selected", callable_mp(this, &ThemeTypeDialog::_add_type_options_cbk));
diff --git a/editor/plugins/tiles/atlas_merging_dialog.cpp b/editor/plugins/tiles/atlas_merging_dialog.cpp
index 5652547349..62b4993947 100644
--- a/editor/plugins/tiles/atlas_merging_dialog.cpp
+++ b/editor/plugins/tiles/atlas_merging_dialog.cpp
@@ -311,6 +311,7 @@ AtlasMergingDialog::AtlasMergingDialog() {
// Atlas sources item list.
atlas_merging_atlases_list = memnew(ItemList);
+ atlas_merging_atlases_list->set_auto_translate(false);
atlas_merging_atlases_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE);
atlas_merging_atlases_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
atlas_merging_atlases_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp
index 661af16ce8..c0aa5b8efa 100644
--- a/editor/plugins/tiles/tile_map_editor.cpp
+++ b/editor/plugins/tiles/tile_map_editor.cpp
@@ -2421,6 +2421,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
sources_bottom_actions->add_child(source_sort_button);
sources_list = memnew(ItemList);
+ sources_list->set_auto_translate(false);
sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE);
sources_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
sources_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
@@ -2460,6 +2461,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
// Scenes collection source.
scene_tiles_list = memnew(ItemList);
+ scene_tiles_list->set_auto_translate(false);
scene_tiles_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
scene_tiles_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
scene_tiles_list->set_select_mode(ItemList::SELECT_MULTI);
@@ -2485,6 +2487,7 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() {
int thumbnail_size = 64;
patterns_item_list = memnew(ItemList);
+ patterns_item_list->set_auto_translate(false);
patterns_item_list->set_max_columns(0);
patterns_item_list->set_icon_mode(ItemList::ICON_MODE_TOP);
patterns_item_list->set_fixed_column_width(thumbnail_size * 3 / 2);
@@ -3560,6 +3563,7 @@ TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() {
tilemap_tab_terrains->add_child(terrains_tree);
terrains_tile_list = memnew(ItemList);
+ terrains_tile_list->set_auto_translate(false);
terrains_tile_list->set_h_size_flags(Control::SIZE_EXPAND_FILL);
terrains_tile_list->set_max_columns(0);
terrains_tile_list->set_same_column_width(true);
diff --git a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp
index 0e244412ab..ba431dfa2f 100644
--- a/editor/plugins/tiles/tile_proxies_manager_dialog.cpp
+++ b/editor/plugins/tiles/tile_proxies_manager_dialog.cpp
@@ -345,6 +345,7 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() {
vbox_container->add_child(source_level_label);
source_level_list = memnew(ItemList);
+ source_level_list->set_auto_translate(false);
source_level_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
source_level_list->set_select_mode(ItemList::SELECT_MULTI);
source_level_list->set_allow_rmb_select(true);
@@ -356,6 +357,7 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() {
vbox_container->add_child(coords_level_label);
coords_level_list = memnew(ItemList);
+ coords_level_list->set_auto_translate(false);
coords_level_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
coords_level_list->set_select_mode(ItemList::SELECT_MULTI);
coords_level_list->set_allow_rmb_select(true);
@@ -367,6 +369,7 @@ TileProxiesManagerDialog::TileProxiesManagerDialog() {
vbox_container->add_child(alternative_level_label);
alternative_level_list = memnew(ItemList);
+ alternative_level_list->set_auto_translate(false);
alternative_level_list->set_v_size_flags(Control::SIZE_EXPAND_FILL);
alternative_level_list->set_select_mode(ItemList::SELECT_MULTI);
alternative_level_list->set_allow_rmb_select(true);
diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp
index 7242920368..bdde662ce1 100644
--- a/editor/plugins/tiles/tile_set_editor.cpp
+++ b/editor/plugins/tiles/tile_set_editor.cpp
@@ -854,6 +854,7 @@ TileSetEditor::TileSetEditor() {
p->set_item_checked(TilesEditorUtils::SOURCE_SORT_ID, true);
sources_list = memnew(ItemList);
+ sources_list->set_auto_translate(false);
sources_list->set_fixed_icon_size(Size2(60, 60) * EDSCALE);
sources_list->set_h_size_flags(SIZE_EXPAND_FILL);
sources_list->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -933,6 +934,7 @@ TileSetEditor::TileSetEditor() {
//// Patterns ////
int thumbnail_size = 64;
patterns_item_list = memnew(ItemList);
+ patterns_item_list->set_auto_translate(false);
patterns_item_list->set_max_columns(0);
patterns_item_list->set_icon_mode(ItemList::ICON_MODE_TOP);
patterns_item_list->set_fixed_column_width(thumbnail_size * 3 / 2);
diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
index 1f4c3651e9..7f6616fe34 100644
--- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
+++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp
@@ -549,6 +549,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() {
split_container_right_side->add_child(right_vbox_container);
scene_tiles_list = memnew(ItemList);
+ scene_tiles_list->set_auto_translate(false);
scene_tiles_list->set_h_size_flags(SIZE_EXPAND_FILL);
scene_tiles_list->set_v_size_flags(SIZE_EXPAND_FILL);
SET_DRAG_FORWARDING_CDU(scene_tiles_list, TileSetScenesCollectionSourceEditor);
diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp
index f7c01ff840..225138dfb3 100644
--- a/modules/gridmap/editor/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp
@@ -1316,6 +1316,7 @@ GridMapEditor::GridMapEditor() {
EDITOR_DEF("editors/grid_map/preview_size", 64);
mesh_library_palette = memnew(ItemList);
+ mesh_library_palette->set_auto_translate(false);
add_child(mesh_library_palette);
mesh_library_palette->set_v_size_flags(SIZE_EXPAND_FILL);
mesh_library_palette->connect("gui_input", callable_mp(this, &GridMapEditor::_mesh_library_palette_input));
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 02d44caa1c..e9d34fae3b 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -44,7 +44,7 @@ void ItemList::_shape_text(int p_idx) {
} else {
item.text_buf->set_direction((TextServer::Direction)item.text_direction);
}
- item.text_buf->add_string(item.text, theme_cache.font, theme_cache.font_size, item.language);
+ item.text_buf->add_string(item.xl_text, theme_cache.font, theme_cache.font_size, item.language);
if (icon_mode == ICON_MODE_TOP && max_text_lines > 0) {
item.text_buf->set_break_flags(TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND | TextServer::BREAK_GRAPHEME_BOUND | TextServer::BREAK_TRIM_EDGE_SPACES);
} else {
@@ -58,6 +58,7 @@ int ItemList::add_item(const String &p_item, const Ref<Texture2D> &p_texture, bo
Item item;
item.icon = p_texture;
item.text = p_item;
+ item.xl_text = atr(p_item);
item.selectable = p_selectable;
items.push_back(item);
int item_id = items.size() - 1;
@@ -94,6 +95,7 @@ void ItemList::set_item_text(int p_idx, const String &p_text) {
}
items.write[p_idx].text = p_text;
+ items.write[p_idx].xl_text = atr(p_text);
_shape_text(p_idx);
queue_redraw();
shape_changed = true;
@@ -1001,7 +1003,6 @@ void ItemList::_notification(int p_what) {
} break;
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
- case NOTIFICATION_TRANSLATION_CHANGED:
case NOTIFICATION_THEME_CHANGED: {
for (int i = 0; i < items.size(); i++) {
_shape_text(i);
@@ -1009,6 +1010,14 @@ void ItemList::_notification(int p_what) {
shape_changed = true;
queue_redraw();
} break;
+ case NOTIFICATION_TRANSLATION_CHANGED: {
+ for (int i = 0; i < items.size(); i++) {
+ items.write[i].xl_text = atr(items[i].text);
+ _shape_text(i);
+ }
+ shape_changed = true;
+ queue_redraw();
+ } break;
case NOTIFICATION_DRAW: {
force_update_list_size();
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index 796e0eb687..28f9012058 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -57,6 +57,7 @@ private:
Color icon_modulate = Color(1, 1, 1, 1);
Ref<Texture2D> tag_icon;
String text;
+ String xl_text;
Ref<TextParagraph> text_buf;
String language;
TextDirection text_direction = TEXT_DIRECTION_AUTO;