summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-08-20 12:51:31 +0200
committerGitHub <noreply@github.com>2019-08-20 12:51:31 +0200
commite84d83ce7805bc3f91c091efd426f1ca4389e044 (patch)
tree522a579f3bb690477f39b9fe8373fd2a05004800 /scene
parente6c4ef345574be727153cbdf26eaaf0531162598 (diff)
parentbe8d569744e4eed9acb313d355d96e6989e92087 (diff)
Merge pull request #31492 from Calinou/file-dialog-color-folders
Use a different color for folder icons in file dialogs
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/file_dialog.cpp2
-rw-r--r--scene/resources/default_theme/default_theme.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp
index f1bdbb5ff5..7305d7459c 100644
--- a/scene/gui/file_dialog.cpp
+++ b/scene/gui/file_dialog.cpp
@@ -400,6 +400,7 @@ void FileDialog::update_file_list() {
TreeItem *root = tree->create_item();
Ref<Texture> folder = get_icon("folder");
+ const Color folder_color = get_color("folder");
List<String> files;
List<String> dirs;
@@ -429,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_color(0, folder_color);
Dictionary d;
d["name"] = dir_name;
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index fb0fb4f8e3..90787780d3 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -760,6 +760,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
// FileDialog
theme->set_icon("folder", "FileDialog", make_icon(icon_folder_png));
+ theme->set_color("folder", "FileDialog", Color(1, 1, 1));
theme->set_color("files_disabled", "FileDialog", Color(0, 0, 0, 0.7));
// colorPicker