From 20ca577cba57bdf8cbb998461947f8d3b127020d Mon Sep 17 00:00:00 2001 From: Jordyfel Date: Mon, 9 Jun 2025 16:28:52 +0300 Subject: [PATCH] Update filesystem dock thumbnail size after changing setting --- editor/filesystem_dock.cpp | 10 ++++++++-- editor/filesystem_dock.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 154f9a85c6..5365d1407a 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -534,6 +534,7 @@ void FileSystemDock::_notification(int p_what) { current_path_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false)); always_show_folders = bool(EDITOR_GET("docks/filesystem/always_show_folders")); + thumbnail_size_setting = EDITOR_GET("docks/filesystem/thumbnail_size"); set_file_list_display_mode(FileSystemDock::FILE_LIST_DISPLAY_LIST); @@ -636,6 +637,12 @@ void FileSystemDock::_notification(int p_what) { do_redraw = true; } + int new_thumbnail_size_setting = EDITOR_GET("docks/filesystem/thumbnail_size"); + if (new_thumbnail_size_setting != thumbnail_size_setting) { + thumbnail_size_setting = new_thumbnail_size_setting; + do_redraw = true; + } + if (do_redraw) { update_all(); } @@ -938,8 +945,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) { String directory = current_path; String file = ""; - int thumbnail_size = EDITOR_GET("docks/filesystem/thumbnail_size"); - thumbnail_size *= EDSCALE; + int thumbnail_size = thumbnail_size_setting * EDSCALE; Ref folder_thumbnail; Ref file_thumbnail; Ref file_thumbnail_broken; diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index bd90f945b6..69c0489226 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -203,6 +203,7 @@ private: CreateDialog *new_resource_dialog = nullptr; bool always_show_folders = false; + int thumbnail_size_setting = 0; bool editor_is_dark_theme = false;