From 6c8db9fd5feb1871890da1b9c6b33b429fb68c8f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sat, 22 Aug 2015 11:02:12 +0200 Subject: FileBrowser: Tweak display of size/time of entries. We have no size for blenlib entries, nor do we have time for those and 'parent' entry. Thanks to Sergey for notifying this on IRC. --- source/blender/editors/space_file/file_draw.c | 39 +++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 36646d46f74..521572628a6 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -641,37 +641,48 @@ void file_draw_list(const bContext *C, ARegion *ar) file_draw_string(sx + 1, tpos, file->name, (float)textwidth, textheight, align); } + sx += (int)layout->column_widths[COLUMN_NAME] + column_space; if (params->display == FILE_SHORTDISPLAY) { - sx += (int)layout->column_widths[COLUMN_NAME] + column_space; - if (!(file->typeflag & FILE_TYPE_DIR)) { + if ((file->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) || + !(file->typeflag & (FILE_TYPE_DIR | FILE_TYPE_BLENDERLIB))) + { if ((file->entry->size_str[0] == '\0') || update_stat_strings) { BLI_filelist_entry_size_to_string(NULL, file->entry->size, small_size, file->entry->size_str); } file_draw_string( sx, sy, file->entry->size_str, layout->column_widths[COLUMN_SIZE], layout->tile_h, align); - sx += (int)layout->column_widths[COLUMN_SIZE] + column_space; } + sx += (int)layout->column_widths[COLUMN_SIZE] + column_space; } else if (params->display == FILE_LONGDISPLAY) { - sx += (int)layout->column_widths[COLUMN_NAME] + column_space; - - if ((file->entry->date_str[0] == '\0') || update_stat_strings) { - BLI_filelist_entry_datetime_to_string( - NULL, file->entry->time, small_size, file->entry->time_str, file->entry->date_str); + if (!(file->typeflag & FILE_TYPE_BLENDERLIB) && !FILENAME_IS_CURRPAR(file->relpath)) + { + if ((file->entry->date_str[0] == '\0') || update_stat_strings) { + BLI_filelist_entry_datetime_to_string( + NULL, file->entry->time, small_size, file->entry->time_str, file->entry->date_str); + } + file_draw_string( + sx, sy, file->entry->date_str, layout->column_widths[COLUMN_DATE], layout->tile_h, align); + sx += (int)layout->column_widths[COLUMN_DATE] + column_space; + file_draw_string( + sx, sy, file->entry->time_str, layout->column_widths[COLUMN_TIME], layout->tile_h, align); + sx += (int)layout->column_widths[COLUMN_TIME] + column_space; + } + else { + sx += (int)layout->column_widths[COLUMN_DATE] + column_space; + sx += (int)layout->column_widths[COLUMN_TIME] + column_space; } - file_draw_string(sx, sy, file->entry->date_str, layout->column_widths[COLUMN_DATE], layout->tile_h, align); - sx += (int)layout->column_widths[COLUMN_DATE] + column_space; - file_draw_string(sx, sy, file->entry->time_str, layout->column_widths[COLUMN_TIME], layout->tile_h, align); - sx += (int)layout->column_widths[COLUMN_TIME] + column_space; - if (!(file->typeflag & FILE_TYPE_DIR)) { + if ((file->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) || + !(file->typeflag & (FILE_TYPE_DIR | FILE_TYPE_BLENDERLIB))) + { if ((file->entry->size_str[0] == '\0') || update_stat_strings) { BLI_filelist_entry_size_to_string(NULL, file->entry->size, small_size, file->entry->size_str); } file_draw_string( sx, sy, file->entry->size_str, layout->column_widths[COLUMN_SIZE], layout->tile_h, align); - sx += (int)layout->column_widths[COLUMN_SIZE] + column_space; } + sx += (int)layout->column_widths[COLUMN_SIZE] + column_space; } } -- cgit v1.2.3