1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

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.
This commit is contained in:
Hugo Locurcio
2019-08-20 00:08:40 +02:00
parent cce148b024
commit be8d569744
5 changed files with 22 additions and 0 deletions

View File

@@ -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