1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Merge pull request #14645 from volzhs/focus-after-select

Focus path field after seleting file browser on Attach script window
This commit is contained in:
Rémi Verschelde
2017-12-16 00:47:15 +01:00
committed by GitHub

View File

@@ -331,6 +331,12 @@ void ScriptCreateDialog::_file_selected(const String &p_file) {
} else { } else {
file_path->set_text(p); file_path->set_text(p);
_path_changed(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();
} }
} }