Răsfoiți Sursa

Merge pull request #68589 from marzecdawid/remove-default-file-save-filedialog

Remove auto selecting the first file for FileDialog with Save mode
Rémi Verschelde 2 ani în urmă
părinte
comite
725f25487c
1 a modificat fișierele cu 5 adăugiri și 2 ștergeri
  1. 5 2
      scene/gui/file_dialog.cpp

+ 5 - 2
scene/gui/file_dialog.cpp

@@ -632,8 +632,11 @@ void FileDialog::update_file_list() {
 		files.pop_front();
 		files.pop_front();
 	}
 	}
 
 
-	if (tree->get_root() && tree->get_root()->get_first_child() && tree->get_selected() == nullptr) {
-		tree->get_root()->get_first_child()->select(0);
+	if (mode != FILE_MODE_SAVE_FILE) {
+		// Select the first file from list if nothing is selected.
+		if (tree->get_root() && tree->get_root()->get_first_child() && tree->get_selected() == nullptr) {
+			tree->get_root()->get_first_child()->select(0);
+		}
 	}
 	}
 }
 }