summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-30 02:04:55 +0200
committerGitHub <noreply@github.com>2022-05-30 02:04:55 +0200
commit6bfea2469567c88d9778883ae4d11d66bc965457 (patch)
tree3acfd3190981a97afd10878497bf33e9e07ee643
parent26bfaf34dda931d5b69713d4fb99e7a73c5dd75c (diff)
parent6cd4d5f061b77b526d58d1adee6f2543b8e4bb6c (diff)
Merge pull request #61505 from ArneStenkrona/script-drop-focus
Ensure focus when dropping to script editor
-rw-r--r--editor/plugins/script_text_editor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index a4bccf30e3..b0cc0bff63 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1524,6 +1524,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
te->set_caret_line(row);
te->set_caret_column(col);
te->insert_text_at_caret(res->get_path());
+ te->grab_focus();
}
if (d.has("type") && (String(d["type"]) == "files" || String(d["type"]) == "files_and_dirs")) {
@@ -1546,6 +1547,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
te->set_caret_line(row);
te->set_caret_column(col);
te->insert_text_at_caret(text_to_drop);
+ te->grab_focus();
}
if (d.has("type") && String(d["type"]) == "nodes") {
@@ -1619,6 +1621,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
te->set_caret_line(row);
te->set_caret_column(col);
te->insert_text_at_caret(text_to_drop);
+ te->grab_focus();
}
if (d.has("type") && String(d["type"]) == "obj_property") {
@@ -1627,6 +1630,7 @@ void ScriptTextEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
te->set_caret_line(row);
te->set_caret_column(col);
te->insert_text_at_caret(text_to_drop);
+ te->grab_focus();
}
}