瀏覽代碼

Avoid selecting the first item automatically in Open Folder Mode

Chia-Hsiang Cheng 2 年之前
父節點
當前提交
f93f1952cb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/file_dialog.cpp

+ 1 - 1
scene/gui/file_dialog.cpp

@@ -666,7 +666,7 @@ void FileDialog::update_file_list() {
 		files.pop_front();
 	}
 
-	if (mode != FILE_MODE_SAVE_FILE) {
+	if (mode != FILE_MODE_SAVE_FILE && mode != FILE_MODE_OPEN_DIR) {
 		// 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);