Browse Source

Merge pull request #102592 from KoBeWi/folderfolder

Navigate to folder when double-clicking favorite
Rémi Verschelde 7 tháng trước cách đây
mục cha
commit
afa068abac
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      editor/filesystem_dock.cpp

+ 3 - 2
editor/filesystem_dock.cpp

@@ -1291,12 +1291,13 @@ void FileSystemDock::_tree_activate_file() {
 		String file_path = selected->get_metadata(0);
 		TreeItem *parent = selected->get_parent();
 		bool is_favorite = parent != nullptr && parent->get_metadata(0) == "Favorites";
+		bool is_folder = file_path.ends_with("/");
 
-		if ((!is_favorite && file_path.ends_with("/")) || file_path == "Favorites") {
+		if ((!is_favorite && is_folder) || file_path == "Favorites") {
 			bool collapsed = selected->is_collapsed();
 			selected->set_collapsed(!collapsed);
 		} else {
-			_select_file(file_path, is_favorite && !file_path.ends_with("/"), false);
+			_select_file(file_path, is_favorite && !is_folder, is_favorite && is_folder);
 		}
 	}
 }