summaryrefslogtreecommitdiffstats
path: root/scene/main
diff options
context:
space:
mode:
authorSpartan322 <Megacake1234@gmail.com>2024-11-15 14:24:07 -0500
committerSpartan322 <Megacake1234@gmail.com>2024-11-15 14:24:07 -0500
commit4a5836e5462554a738b502aa8bbde5e4a051eb56 (patch)
treed58eaa8daad3e30c8b84a50e70a21f93b05525c5 /scene/main
parentac1a49725fc038ae11ef9060fecb2b0f9c6333b2 (diff)
parent6c05ec3d6732cac44cf85c91db7d3fd1075bcb23 (diff)
downloadredot-engine-4a5836e5462554a738b502aa8bbde5e4a051eb56.tar.gz
Merge commit godotengine/godot@6c05ec3d6732cac44cf85c91db7d3fd1075bcb23
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp2
-rw-r--r--scene/main/window.cpp5
-rw-r--r--scene/main/window.h1
3 files changed, 7 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 4a808c4081..8a48b99040 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -332,7 +332,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 ab9c56d56c..3a2245c555 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -305,6 +305,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 d0f9cd11b9..00345e7b82 100644
--- a/scene/main/window.h
+++ b/scene/main/window.h
@@ -276,6 +276,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;