1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Improve auto-translation of Script Editor

This commit is contained in:
kobewi
2025-05-30 01:28:43 +02:00
parent 1b37dacc18
commit c32a031908
8 changed files with 141 additions and 91 deletions

View File

@@ -3249,9 +3249,26 @@ void EditorHelp::_notification(int p_what) {
update_toggle_files_button();
} break;
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
case NOTIFICATION_TRANSLATION_CHANGED:
case NOTIFICATION_VISIBILITY_CHANGED: {
if (update_pending && is_visible_in_tree()) {
_update_doc();
}
update_toggle_files_button();
} break;
case NOTIFICATION_TRANSLATION_CHANGED: {
if (!is_ready()) {
break;
}
if (is_visible_in_tree()) {
_update_doc();
} else {
update_pending = true;
}
[[fallthrough]];
}
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED: {
update_toggle_files_button();
} break;
}
@@ -3372,6 +3389,7 @@ EditorHelp::EditorHelp() {
toggle_files_button = memnew(Button);
toggle_files_button->set_accessibility_name(TTRC("Scripts"));
toggle_files_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
toggle_files_button->set_flat(true);
toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelp::_toggle_files_pressed));
status_bar->add_child(toggle_files_button);