From 4995a4b90c182895e8d92adff0e228aae68af4e2 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 12 Oct 2023 02:48:48 +0200 Subject: [PATCH] Fix issues with the new FileSystem dock settings. --- editor/editor_settings.cpp | 1 + editor/filesystem_dock.cpp | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 8547e637d..4401ad74f 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -428,6 +428,7 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { hints["docks/filesystem/thumbnail_size"] = PropertyInfo(Variant::INT, "docks/filesystem/thumbnail_size", PROPERTY_HINT_RANGE, "32,128,16"); _initial_set("docks/filesystem/always_show_folders", true); _initial_set("docks/filesystem/wide_bottom_panel", false); + hints["docks/filesystem/wide_bottom_panel"] = PropertyInfo(Variant::BOOL, "docks/filesystem/wide_bottom_panel", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED); // Property editor _initial_set("docks/property_editor/auto_refresh_interval", 0.3); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 7952ec97d..3ad53bd5d 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -333,13 +333,24 @@ void FileSystemDock::_update_tree(const Vector &p_uncollapsed_paths, boo } void FileSystemDock::set_display_mode(DisplayMode p_display_mode) { - display_mode = p_display_mode; - _update_display_mode(false); + if (display_mode != DISPLAY_MODE_WIDE && p_display_mode != DISPLAY_MODE_WIDE) { + display_mode = p_display_mode; + _update_display_mode(false); + } } void FileSystemDock::_update_display_mode(bool p_force) { if (old_display_mode == DISPLAY_MODE_WIDE || display_mode == DISPLAY_MODE_WIDE) { // Changing between wide and normal needs restart, ignore + + if (p_force || old_display_mode != display_mode) { + tree->ensure_cursor_is_visible(); + _update_tree(_compute_uncollapsed_paths()); + _update_file_list(true); + } + + old_display_mode = display_mode; + return; } @@ -1032,10 +1043,6 @@ void FileSystemDock::_fs_changed() { split_box->show(); } - if (wide_hsplit_box) { - wide_hsplit_box->show(); - } - if (tree->is_visible()) { _update_tree(_compute_uncollapsed_paths()); } @@ -1055,10 +1062,6 @@ void FileSystemDock::_set_scanning_mode() { split_box->hide(); } - if (wide_hsplit_box) { - wide_hsplit_box->hide(); - } - scanning_vb->show(); set_process(true); if (EditorFileSystem::get_singleton()->is_scanning()) {