diff options
author | Eric M <itsjusteza@gmail.com> | 2022-10-23 18:45:44 +1000 |
---|---|---|
committer | Eric M <itsjusteza@gmail.com> | 2022-10-25 19:52:42 +1000 |
commit | d499071e5b448a11fb3e815c33ab55cd4c23b5c1 (patch) | |
tree | ff023d3d7aca34bbe459297376b58076dd3a9759 /editor/plugins/script_text_editor.cpp | |
parent | 4546986d21e862cd11d9d541f6e8347483fd7f69 (diff) | |
download | redot-engine-d499071e5b448a11fb3e815c33ab55cd4c23b5c1.tar.gz |
Set the shortcut context for the edit/search/goto menus to the ScriptEditor so that shortcuts continue to work when FindReplaceBar is focused.
Diffstat (limited to 'editor/plugins/script_text_editor.cpp')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 7d7ef9245f..e54a338c09 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -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() { |