From ac411c9f4824c99f3e134b4243085deac724c753 Mon Sep 17 00:00:00 2001 From: volzhs Date: Thu, 14 Dec 2017 11:25:00 +0900 Subject: [PATCH] Focus path field after seleting file browser on Attach script window --- editor/script_create_dialog.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 3cab14b0c4e..c4cea837840 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -331,6 +331,12 @@ void ScriptCreateDialog::_file_selected(const String &p_file) { } else { file_path->set_text(p); _path_changed(p); + + String filename = p.get_file().get_basename(); + int select_start = p.find_last(filename); + file_path->select(select_start, select_start + filename.length()); + file_path->set_cursor_position(select_start + filename.length()); + file_path->grab_focus(); } }