summaryrefslogtreecommitdiff
path: root/scene/gui/file_dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/file_dialog.cpp')
-rw-r--r--scene/gui/file_dialog.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index 04fb991f78..9bc593ea3b 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -400,14 +400,14 @@ void FileDialog::update_file_list() {
TreeItem *root = tree->create_item();
Ref<Texture> folder = get_icon("folder");
+ const Color folder_color = get_color("folder_icon_modulate");
List<String> files;
List<String> dirs;
- bool is_dir;
bool is_hidden;
String item;
- while ((item = dir_access->get_next(&is_dir)) != "") {
+ while ((item = dir_access->get_next()) != "") {
if (item == "." || item == "..")
continue;
@@ -415,7 +415,7 @@ void FileDialog::update_file_list() {
is_hidden = dir_access->current_is_hidden();
if (show_hidden_files || !is_hidden) {
- if (!is_dir)
+ if (!dir_access->current_is_dir())
files.push_back(item);
else
dirs.push_back(item);
@@ -430,6 +430,7 @@ void FileDialog::update_file_list() {
TreeItem *ti = tree->create_item(root);
ti->set_text(0, dir_name);
ti->set_icon(0, folder);
+ ti->set_icon_modulate(0, folder_color);
Dictionary d;
d["name"] = dir_name;
@@ -880,14 +881,14 @@ FileDialog::FileDialog() {
dir->set_h_size_flags(SIZE_EXPAND_FILL);
refresh = memnew(ToolButton);
- refresh->set_tooltip(RTR("Refresh"));
+ refresh->set_tooltip(RTR("Refresh files."));
refresh->connect("pressed", this, "_update_file_list");
hbc->add_child(refresh);
show_hidden = memnew(ToolButton);
show_hidden->set_toggle_mode(true);
show_hidden->set_pressed(is_showing_hidden_files());
- show_hidden->set_tooltip(RTR("Toggle Hidden Files"));
+ show_hidden->set_tooltip(RTR("Toggle the visibility of hidden files."));
show_hidden->connect("toggled", this, "set_show_hidden_files");
hbc->add_child(show_hidden);