mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 10:44:26 +00:00
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:
parent
4546986d21
commit
d499071e5b
6 changed files with 27 additions and 9 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue