Переглянути джерело

Merge pull request #104703 from bruvzg/loc_dir_icons

Fix updating editor icons on translation change.
Rémi Verschelde 4 місяців тому
батько
коміт
fd02ff8d02

+ 12 - 0
editor/code_editor.cpp

@@ -144,6 +144,11 @@ void FindReplaceBar::_notification(int p_what) {
 			_update_toggle_replace_button(replace_text->is_visible_in_tree());
 		} break;
 
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED: {
+			_update_toggle_replace_button(replace_text->is_visible_in_tree());
+		} break;
+
 		case NOTIFICATION_VISIBILITY_CHANGED: {
 			set_process_input(is_visible_in_tree());
 		} break;
@@ -1649,6 +1654,13 @@ void CodeTextEditor::_notification(int p_what) {
 			_update_text_editor_theme();
 		} break;
 
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED: {
+			if (toggle_scripts_button->is_visible()) {
+				update_toggle_scripts_button();
+			}
+		} break;
+
 		case NOTIFICATION_VISIBILITY_CHANGED: {
 			if (toggle_scripts_button->is_visible()) {
 				update_toggle_scripts_button();

+ 2 - 0
editor/editor_dock_manager.cpp

@@ -856,6 +856,8 @@ EditorDockManager::EditorDockManager() {
 
 void DockContextPopup::_notification(int p_what) {
 	switch (p_what) {
+		case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED:
 		case NOTIFICATION_THEME_CHANGED: {
 			if (make_float_button) {
 				make_float_button->set_button_icon(get_editor_theme_icon(SNAME("MakeFloating")));

+ 2 - 0
editor/editor_help.cpp

@@ -3236,6 +3236,8 @@ void EditorHelp::_notification(int p_what) {
 			update_toggle_scripts_button();
 		} break;
 
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED:
 		case NOTIFICATION_VISIBILITY_CHANGED: {
 			update_toggle_scripts_button();
 		} break;

+ 5 - 0
editor/gui/editor_scene_tabs.cpp

@@ -67,6 +67,11 @@ void EditorSceneTabs::_notification(int p_what) {
 				_scene_tabs_resized();
 			}
 		} break;
+
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED: {
+			_scene_tabs_resized();
+		} break;
 	}
 }
 

+ 2 - 0
editor/gui/editor_spin_slider.cpp

@@ -457,6 +457,8 @@ void EditorSpinSlider::_notification(int p_what) {
 			_update_value_input_stylebox();
 		} break;
 
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED:
 		case NOTIFICATION_THEME_CHANGED: {
 			_update_value_input_stylebox();
 		} break;

+ 2 - 1
editor/plugins/control_editor_plugin.cpp

@@ -104,7 +104,8 @@ void ControlPositioningWarning::gui_input(const Ref<InputEvent> &p_event) {
 
 void ControlPositioningWarning::_notification(int p_notification) {
 	switch (p_notification) {
-		case NOTIFICATION_ENTER_TREE:
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED:
 		case NOTIFICATION_THEME_CHANGED:
 			_update_warning();
 			_update_toggler();

+ 5 - 0
editor/plugins/sprite_frames_editor_plugin.cpp

@@ -672,6 +672,11 @@ void SpriteFramesEditor::_notification(int p_what) {
 			_update_show_settings();
 		} break;
 
+		case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
+		case NOTIFICATION_TRANSLATION_CHANGED: {
+			_update_show_settings();
+		} break;
+
 		case NOTIFICATION_READY: {
 			add_theme_constant_override("autohide", 1); // Fixes the dragger always showing up.
 		} break;