Skip to content

Commit

Permalink
Don't use icons and don't sort in EditorQuickOpen for some easy speed…
Browse files Browse the repository at this point in the history
… gains.
  • Loading branch information
Relintai committed Mar 17, 2024
1 parent 9a6e66b commit f277dfc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions editor/quick_open.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ void EditorQuickOpen::_parse_fs(EditorFileSystemDirectory *efsd, Vector<Pair<Str
if (ed.class_equals_or_inherits(class_name, base_types[j]) && search_text.is_subsequence_ofi(file)) {
Pair<String, Ref<Texture>> pair;
pair.first = file;
StringName icon_name = search_options->has_theme_icon(file_type, ei) ? file_type : ot;
pair.second = search_options->get_theme_icon(icon_name, ei);
//StringName icon_name = search_options->has_theme_icon(file_type, ei) ? file_type : ot;
//pair.second = search_options->get_theme_icon(icon_name, ei);
list.push_back(pair);

// Stop testing base types as soon as we got a match.
Expand Down Expand Up @@ -207,15 +207,16 @@ void EditorQuickOpen::_update_search() {
search_options->clear();
TreeItem *root = search_options->create_item();
EditorFileSystemDirectory *efsd = EditorFileSystem::get_singleton()->get_filesystem();

Vector<Pair<String, Ref<Texture>>> list;

_parse_fs(efsd, list);
list = _sort_fs(list);
//list = _sort_fs(list);

for (int i = 0; i < list.size(); i++) {
TreeItem *ti = search_options->create_item(root);
ti->set_text(0, list[i].first);
ti->set_icon(0, list[i].second);
//ti->set_icon(0, list[i].second);
}

if (root->get_children()) {
Expand Down

0 comments on commit f277dfc

Please sign in to comment.