Skip to content

Commit b54197a

Browse files
committed
Merge pull request #107323 from Jordyfel/fs-dock-thumbnail-size-fix
Filesystem dock: Fix thumbnail size not updating instantly after changing editor setting
2 parents 0fe406c + 20ca577 commit b54197a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

editor/filesystem_dock.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ void FileSystemDock::_notification(int p_what) {
534534
current_path_line_edit->connect(SceneStringName(text_submitted), callable_mp(this, &FileSystemDock::_navigate_to_path).bind(false));
535535

536536
always_show_folders = bool(EDITOR_GET("docks/filesystem/always_show_folders"));
537+
thumbnail_size_setting = EDITOR_GET("docks/filesystem/thumbnail_size");
537538

538539
set_file_list_display_mode(FileSystemDock::FILE_LIST_DISPLAY_LIST);
539540

@@ -636,6 +637,12 @@ void FileSystemDock::_notification(int p_what) {
636637
do_redraw = true;
637638
}
638639

640+
int new_thumbnail_size_setting = EDITOR_GET("docks/filesystem/thumbnail_size");
641+
if (new_thumbnail_size_setting != thumbnail_size_setting) {
642+
thumbnail_size_setting = new_thumbnail_size_setting;
643+
do_redraw = true;
644+
}
645+
639646
if (do_redraw) {
640647
update_all();
641648
}
@@ -938,8 +945,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
938945
String directory = current_path;
939946
String file = "";
940947

941-
int thumbnail_size = EDITOR_GET("docks/filesystem/thumbnail_size");
942-
thumbnail_size *= EDSCALE;
948+
int thumbnail_size = thumbnail_size_setting * EDSCALE;
943949
Ref<Texture2D> folder_thumbnail;
944950
Ref<Texture2D> file_thumbnail;
945951
Ref<Texture2D> file_thumbnail_broken;

editor/filesystem_dock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ class FileSystemDock : public VBoxContainer {
203203
CreateDialog *new_resource_dialog = nullptr;
204204

205205
bool always_show_folders = false;
206+
int thumbnail_size_setting = 0;
206207

207208
bool editor_is_dark_theme = false;
208209

0 commit comments

Comments
 (0)