Skip to content

Commit

Permalink
Fix FileSystemDock thumbnails sometimes not displaying
Browse files Browse the repository at this point in the history
There were (at least) three cases where thumbnails would not display, if they were generated while the FileSystemDock was not visible:
	- current_path == "Favorites", due to p_path not starting with "Favorites"
	- current_path == "res://", due to current_path having last "/" trimmed for comparison
	- current_path pointing to a selected file instead of folder, since it no longer matches p_path's base directory

This change removes the current_path and is_visible_in_tree checks when determining whether to update the file's icon.

Fixes godotengine#90801
Fixes godotengine#91432
  • Loading branch information
aaronp64 authored and 2nafish117 committed Aug 5, 2024
1 parent 6222a9c commit d72a628
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/filesystem_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ void FileSystemDock::navigate_to_path(const String &p_path) {
}

void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) {
if ((file_list_vb->is_visible_in_tree() || current_path.trim_suffix("/") == p_path.get_base_dir()) && p_preview.is_valid()) {
if (p_preview.is_valid()) {
Array uarr = p_udata;
int idx = uarr[0];
String file = uarr[1];
Expand Down

0 comments on commit d72a628

Please sign in to comment.