summaryrefslogtreecommitdiffstats
path: root/editor/editor_themes.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-08-20 00:08:40 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-08-20 00:10:27 +0200
commitbe8d569744e4eed9acb313d355d96e6989e92087 (patch)
tree11458a465c0dc56c159e89f53b7bd0f03afd44d4 /editor/editor_themes.cpp
parentcce148b0242836b5c32a7fa6c39013a2fc1c9eff (diff)
downloadredot-engine-be8d569744e4eed9acb313d355d96e6989e92087.tar.gz
Use a different color for folder icons in file dialogs
This makes them easier to distinguish from files for quick visual grepping. This can also be used in projects by setting the FileDialog "folder" color. The default value (`Color(1, 1, 1)`) has no visual impact, for compatibility with existing projects.
Diffstat (limited to 'editor/editor_themes.cpp')
-rw-r--r--editor/editor_themes.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index 9c1e919824..d962001b38 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -1066,6 +1066,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
// FileDialog
theme->set_icon("folder", "FileDialog", theme->get_icon("Folder", "EditorIcons"));
+ // Use a different color for folder icons to make them easier to distinguish from files.
+ // On a light theme, the icon will be dark, so we need to lighten it before blending it with the accent color.
+ theme->set_color("folder", "FileDialog", (dark_theme ? Color(1, 1, 1) : Color(5, 5, 5)).linear_interpolate(accent_color, 0.7));
theme->set_color("files_disabled", "FileDialog", font_color_disabled);
// color picker