Set the shortcut context for the edit/search/goto menus to the ScriptEditor so that shortcuts continue to work when FindReplaceBar is focused.

This commit is contained in:
Eric M 2022-10-23 18:45:44 +10:00
parent 4546986d21
commit d499071e5b
6 changed files with 27 additions and 9 deletions

View file

@ -151,7 +151,7 @@ void ScriptTextEditor::set_edited_resource(const Ref<Resource> &p_res) {
code_editor->update_line_and_column();
}
void ScriptTextEditor::enable_editor() {
void ScriptTextEditor::enable_editor(Control *p_shortcut_context) {
if (editor_enabled) {
return;
}
@ -161,6 +161,15 @@ void ScriptTextEditor::enable_editor() {
_enable_code_editor();
_validate_script();
if (p_shortcut_context) {
for (int i = 0; i < edit_hb->get_child_count(); ++i) {
Control *c = cast_to<Control>(edit_hb->get_child(i));
if (c) {
c->set_shortcut_context(p_shortcut_context);
}
}
}
}
void ScriptTextEditor::_load_theme_settings() {