1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-15 13:51:40 +00:00

Fix FILE_MODE_OPEN_ANY file dialog not selecting folders.

This commit is contained in:
Pāvels Nadtočajevs
2025-01-27 10:08:32 +02:00
parent e5498020b6
commit adceb32177
2 changed files with 11 additions and 2 deletions

View File

@@ -637,8 +637,10 @@ void FileDialog::deselect_all() {
set_ok_button_text(ETR("Select Current Folder"));
break;
case FILE_MODE_OPEN_ANY:
set_ok_button_text(ETR("Open"));
break;
case FILE_MODE_SAVE_FILE:
// FIXME: Implement, or refactor to avoid duplication with set_mode
set_ok_button_text(ETR("Save"));
break;
}
}
@@ -657,7 +659,13 @@ void FileDialog::_tree_selected() {
if (!d["dir"]) {
file->set_text(d["name"]);
} else if (mode == FILE_MODE_OPEN_DIR) {
if (mode == FILE_MODE_SAVE_FILE) {
set_ok_button_text(ETR("Save"));
} else {
set_ok_button_text(ETR("Open"));
}
} else if (mode == FILE_MODE_OPEN_DIR || mode == FILE_MODE_OPEN_ANY) {
file->set_text("");
set_ok_button_text(ETR("Select This Folder"));
}