From 06791e1acd2bd19395c9b80c9646ece095262936 Mon Sep 17 00:00:00 2001 From: Stijn Hinlopen Date: Sat, 2 Dec 2023 21:33:38 +0100 Subject: New Quick Open Dialog - Updated list view with thumbnails, and separate file name. - Added a grid view which has larger icons. - Added toggle to filter out files from addons. - Store history for each opened resource type. New Editor settings for Quick Open: - Startup display mode (grid or list): - Determined by the requested resource type. - Whatever was last used. - Toggle to filter out files from addons (for persistence). Notes - The dialog is now created once in EditorNode, and globally available for other components. - A fixed number of result scenes are instantiated, and reused based on query. - Drop support for multiselect. --- editor/editor_resource_preview.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'editor/editor_resource_preview.cpp') diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp index a50b2f3dcc..581a01a5ed 100644 --- a/editor/editor_resource_preview.cpp +++ b/editor/editor_resource_preview.cpp @@ -414,6 +414,24 @@ void EditorResourcePreview::_update_thumbnail_sizes() { } } +EditorResourcePreview::PreviewItem EditorResourcePreview::get_resource_preview_if_available(const String &p_path) { + PreviewItem item; + { + MutexLock lock(preview_mutex); + + HashMap::Iterator I = cache.find(p_path); + if (!I) { + return item; + } + + EditorResourcePreview::Item &cached_item = I->value; + item.preview = cached_item.preview; + item.small_preview = cached_item.small_preview; + } + preview_sem.post(); + return item; +} + void EditorResourcePreview::queue_edited_resource_preview(const Ref &p_res, Object *p_receiver, const StringName &p_receiver_func, const Variant &p_userdata) { ERR_FAIL_NULL(p_receiver); ERR_FAIL_COND(!p_res.is_valid()); -- cgit v1.2.3