@@ -973,35 +973,6 @@ void EditorFileDialog::update_file_name() {
973973 }
974974}
975975
976- // TODO: Could use a unit test.
977- Color EditorFileDialog::get_dir_icon_color (const String &p_dir_path) {
978- if (!FileSystemDock::get_singleton ()) { // This dialog can be called from the project manager.
979- return theme_cache.folder_icon_color ;
980- }
981-
982- const HashMap<String, Color> &folder_colors = FileSystemDock::get_singleton ()->get_folder_colors ();
983- Dictionary assigned_folder_colors = FileSystemDock::get_singleton ()->get_assigned_folder_colors ();
984-
985- Color folder_icon_color = theme_cache.folder_icon_color ;
986-
987- // Check for a folder color to inherit (if one is assigned).
988- String parent_dir = ProjectSettings::get_singleton ()->localize_path (p_dir_path);
989- while (!parent_dir.is_empty () && parent_dir != " res://" ) {
990- if (!parent_dir.ends_with (" /" )) {
991- parent_dir += " /" ;
992- }
993- if (assigned_folder_colors.has (parent_dir)) {
994- folder_icon_color = folder_colors[assigned_folder_colors[parent_dir]];
995- if (folder_icon_color != theme_cache.folder_icon_color ) {
996- break ;
997- }
998- }
999- parent_dir = parent_dir.trim_suffix (" /" ).get_base_dir ();
1000- }
1001-
1002- return folder_icon_color;
1003- }
1004-
1005976// DO NOT USE THIS FUNCTION UNLESS NEEDED, CALL INVALIDATE() INSTEAD.
1006977void EditorFileDialog::update_file_list () {
1007978 int thumbnail_size = EDITOR_GET (" filesystem/file_dialog/thumbnail_size" );
@@ -1155,7 +1126,7 @@ void EditorFileDialog::update_file_list() {
11551126 d[" bundle" ] = bundle;
11561127
11571128 item_list->set_item_metadata (-1 , d);
1158- item_list->set_item_icon_modulate (-1 , get_dir_icon_color (String (d[" path" ])));
1129+ item_list->set_item_icon_modulate (-1 , FileSystemDock:: get_dir_icon_color (String (d[" path" ]), theme_cache. folder_icon_color ));
11591130 }
11601131
11611132 dirs.pop_front ();
@@ -1840,7 +1811,7 @@ void EditorFileDialog::_update_favorites() {
18401811 favorites->add_item (favorited_names[i], theme_cache.folder );
18411812 favorites->set_item_tooltip (-1 , favorited_paths[i]);
18421813 favorites->set_item_metadata (-1 , favorited_paths[i]);
1843- favorites->set_item_icon_modulate (-1 , get_dir_icon_color (favorited_paths[i]));
1814+ favorites->set_item_icon_modulate (-1 , FileSystemDock:: get_dir_icon_color (favorited_paths[i], theme_cache. folder_icon_color ));
18441815
18451816 if (i == current_favorite) {
18461817 favorite->set_pressed (true );
@@ -1925,7 +1896,7 @@ void EditorFileDialog::_update_recent() {
19251896 recent->add_item (recentd_names[i], theme_cache.folder );
19261897 recent->set_item_tooltip (-1 , recentd_paths[i]);
19271898 recent->set_item_metadata (-1 , recentd_paths[i]);
1928- recent->set_item_icon_modulate (-1 , get_dir_icon_color (recentd_paths[i]));
1899+ recent->set_item_icon_modulate (-1 , FileSystemDock:: get_dir_icon_color (recentd_paths[i], theme_cache. folder_icon_color ));
19291900 }
19301901
19311902 if (modified) {
0 commit comments