diff options
Diffstat (limited to 'tools/editor/filesystem_dock.cpp')
-rw-r--r-- | tools/editor/filesystem_dock.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index b85bd6dfdb..021d5c4eb9 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -170,7 +170,7 @@ void FileSystemDock::_notification(int p_what) { _update_tree(); //maybe it finished already if (EditorFileSystem::get_singleton()->is_scanning()) { - _set_scannig_mode(); + _set_scanning_mode(); } } break; @@ -662,7 +662,7 @@ void FileSystemDock::_fs_changed() { set_process(false); } -void FileSystemDock::_set_scannig_mode() { +void FileSystemDock::_set_scanning_mode() { split_box->hide(); button_hist_prev->set_disabled(true); @@ -1174,7 +1174,7 @@ void FileSystemDock::_search_changed(const String& p_text) { void FileSystemDock::_rescan() { - _set_scannig_mode(); + _set_scanning_mode(); EditorFileSystem::get_singleton()->scan(); } @@ -1186,6 +1186,14 @@ void FileSystemDock::fix_dependencies(const String& p_for_file) { void FileSystemDock::focus_on_filter() { + if (!search_box->is_visible_in_tree()) { + // Tree mode, switch to files list with search box + tree->hide(); + file_list_vb->show(); + button_favorite->hide(); + } + + search_box->grab_focus(); } void FileSystemDock::set_display_mode(int p_mode) { @@ -1618,6 +1626,19 @@ void FileSystemDock::_files_list_rmb_select(int p_item,const Vector2& p_pos) { } +void FileSystemDock::select_file(const String& p_file) { + + _go_to_dir(p_file.get_base_dir()); + for(int i=0;i<files->get_item_count();i++) { + if (files->get_item_metadata(i)==p_file) { + files->select(i); + files->ensure_current_is_visible(); + break; + } + } + +} + void FileSystemDock::_bind_methods() { ClassDB::bind_method(_MD("_update_tree"),&FileSystemDock::_update_tree); |