diff options
author | Stijn Hinlopen <f.a.hinlopen@gmail.com> | 2023-12-02 21:33:38 +0100 |
---|---|---|
committer | Stijn Hinlopen <f.a.hinlopen@gmail.com> | 2024-10-01 21:39:16 +0200 |
commit | 06791e1acd2bd19395c9b80c9646ece095262936 (patch) | |
tree | 339cc5059e871f33c90af37aec685ba58ba98198 /editor/editor_resource_preview.cpp | |
parent | f4af8201bac157b9d47e336203d3e8a8ef729de2 (diff) | |
download | redot-engine-06791e1acd2bd19395c9b80c9646ece095262936.tar.gz |
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.
Diffstat (limited to 'editor/editor_resource_preview.cpp')
-rw-r--r-- | editor/editor_resource_preview.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
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<String, EditorResourcePreview::Item>::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<Resource> &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()); |