diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-08-22 12:02:12 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-08-22 12:02:12 +0300 |
commit | 6c8db9fd5feb1871890da1b9c6b33b429fb68c8f (patch) | |
tree | 32b4cf2b24ceaf6059d9ac5efd1718af79181ecd | |
parent | 86690915f11ebfe959d8dfe5eb80e844754aa819 (diff) |
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.
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 39 |
1 files changed, 25 insertions, 14 deletions
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; } } |