summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/gui/editor_file_dialog.cpp2
-rw-r--r--scene/gui/file_dialog.cpp4
-rw-r--r--scene/main/viewport.cpp2
-rw-r--r--scene/main/window.cpp5
-rw-r--r--scene/main/window.h1
5 files changed, 10 insertions, 4 deletions
diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp
index ceff62723f..b2eeeebd7a 100644
--- a/editor/gui/editor_file_dialog.cpp
+++ b/editor/gui/editor_file_dialog.cpp
@@ -65,7 +65,7 @@ void EditorFileDialog::_native_popup() {
} else if (access == ACCESS_USERDATA) {
root = OS::get_singleton()->get_user_data_dir();
}
- DisplayServer::get_singleton()->file_dialog_with_options_show(get_title(), ProjectSettings::get_singleton()->globalize_path(dir->get_text()), root, file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, _get_options(), callable_mp(this, &EditorFileDialog::_native_dialog_cb));
+ DisplayServer::get_singleton()->file_dialog_with_options_show(get_translated_title(), ProjectSettings::get_singleton()->globalize_path(dir->get_text()), root, file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, _get_options(), callable_mp(this, &EditorFileDialog::_native_dialog_cb));
}
void EditorFileDialog::popup(const Rect2i &p_rect) {
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 9eda1a256f..c364888502 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -68,9 +68,9 @@ void FileDialog::_native_popup() {
root = OS::get_singleton()->get_user_data_dir();
}
if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_NATIVE_DIALOG_FILE_EXTRA)) {
- DisplayServer::get_singleton()->file_dialog_with_options_show(get_title(), ProjectSettings::get_singleton()->globalize_path(dir->get_text()), root, file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, _get_options(), callable_mp(this, &FileDialog::_native_dialog_cb_with_options));
+ DisplayServer::get_singleton()->file_dialog_with_options_show(get_translated_title(), ProjectSettings::get_singleton()->globalize_path(dir->get_text()), root, file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, _get_options(), callable_mp(this, &FileDialog::_native_dialog_cb_with_options));
} else {
- DisplayServer::get_singleton()->file_dialog_show(get_title(), ProjectSettings::get_singleton()->globalize_path(dir->get_text()), file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, callable_mp(this, &FileDialog::_native_dialog_cb));
+ DisplayServer::get_singleton()->file_dialog_show(get_translated_title(), ProjectSettings::get_singleton()->globalize_path(dir->get_text()), file->get_text().get_file(), show_hidden_files, DisplayServer::FileDialogMode(mode), filters, callable_mp(this, &FileDialog::_native_dialog_cb));
}
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 1ee99099ec..e70407f36e 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -330,7 +330,7 @@ void Viewport::_sub_window_update(Window *p_window) {
int close_h_ofs = p_window->theme_cache.close_h_offset;
int close_v_ofs = p_window->theme_cache.close_v_offset;
- TextLine title_text = TextLine(p_window->atr(p_window->get_title()), title_font, font_size);
+ TextLine title_text = TextLine(p_window->get_translated_title(), title_font, font_size);
title_text.set_width(r.size.width - panel->get_minimum_size().x - close_h_ofs);
title_text.set_direction(p_window->is_layout_rtl() ? TextServer::DIRECTION_RTL : TextServer::DIRECTION_LTR);
int x = (r.size.width - title_text.get_size().x) / 2;
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index fc2fe4320b..05904fa8f9 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -303,6 +303,11 @@ String Window::get_title() const {
return title;
}
+String Window::get_translated_title() const {
+ ERR_READ_THREAD_GUARD_V(String());
+ return tr_title;
+}
+
void Window::_settings_changed() {
if (visible && initial_position != WINDOW_INITIAL_POSITION_ABSOLUTE && is_in_edited_scene_root()) {
Size2 screen_size = Size2(GLOBAL_GET("display/window/size/viewport_width"), GLOBAL_GET("display/window/size/viewport_height"));
diff --git a/scene/main/window.h b/scene/main/window.h
index 0994fc6012..a1d95ab91f 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -274,6 +274,7 @@ public:
void set_title(const String &p_title);
String get_title() const;
+ String get_translated_title() const;
void set_initial_position(WindowInitialPosition p_initial_position);
WindowInitialPosition get_initial_position() const;