summaryrefslogtreecommitdiff
path: root/editor/script_create_dialog.cpp
diff options
context:
space:
mode:
authorvolzhs <volzhs@gmail.com>2017-12-14 11:25:00 +0900
committervolzhs <volzhs@gmail.com>2017-12-14 11:25:00 +0900
commitac411c9f4824c99f3e134b4243085deac724c753 (patch)
tree7af059e4aa0d0e211a279937a32f344aa9414706 /editor/script_create_dialog.cpp
parent56a44ca03e05a831e5c3c965a4675d53f82e7e6e (diff)
Focus path field after seleting file browser on Attach script window
Diffstat (limited to 'editor/script_create_dialog.cpp')
-rw-r--r--editor/script_create_dialog.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 3cab14b0c4..c4cea83784 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();
}
}