[Bf-blender-cvs] [1cfbd0e4760] filebrowser_redesign: Improve display of 'Date Modified' & 'Size' column strings

Julian Eisel noreply at git.blender.org
Sat Aug 10 15:59:54 CEST 2019


Commit: 1cfbd0e4760af54dd3ad2b8269463c35e346ad95
Author: Julian Eisel
Date:   Sat Aug 10 15:56:45 2019 +0200
Branches: filebrowser_redesign
https://developer.blender.org/rB1cfbd0e4760af54dd3ad2b8269463c35e346ad95

Improve display of 'Date Modified' & 'Size'  column strings

* Left align 'Date Modified' column strings
* Cleaner & more clear format of date/time string
* Fix size column strings clipping after two digits

===================================================================

M	source/blender/blenlib/intern/BLI_filelist.c
M	source/blender/editors/space_file/file_draw.c
M	source/blender/editors/space_file/filesel.c

===================================================================

diff --git a/source/blender/blenlib/intern/BLI_filelist.c b/source/blender/blenlib/intern/BLI_filelist.c
index c2b51d6bb29..33baba1e8a4 100644
--- a/source/blender/blenlib/intern/BLI_filelist.c
+++ b/source/blender/blenlib/intern/BLI_filelist.c
@@ -369,7 +369,7 @@ void BLI_filelist_entry_datetime_to_string(const struct stat *st,
   if (r_date) {
     strftime(r_date,
              sizeof(*r_date) * FILELIST_DIRENTRY_DATE_LEN,
-             compact ? "%d/%m/%y" : "%d-%b-%y",
+             compact ? "%d/%m/%y" : "%d %b %Y",
              tm);
   }
 }
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 1daffc3cdc8..711555b028f 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -500,7 +500,7 @@ static const char *filelist_get_details_column_string(FileListColumns column,
           char date[16], time[8];
           BLI_filelist_entry_datetime_to_string(NULL, file->entry->time, small_size, time, date);
           BLI_snprintf(
-              file->entry->datetime_str, sizeof(file->entry->datetime_str), "%s %s", date, time);
+              file->entry->datetime_str, sizeof(file->entry->datetime_str), "%s, %s", date, time);
         }
 
         return file->entry->datetime_str;
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index 13bc8bb3dfb..78e3c8831b3 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -619,9 +619,10 @@ static void details_columns_widths(const FileSelectParams *params, FileLayout *l
   }
 
   /* Biggest possible reasonable values... */
-  columns[COLUMN_DATETIME].width = file_string_width(small_size ? "23/08/89" : "23-Dec-89 23:59") +
+  columns[COLUMN_DATETIME].width = file_string_width(small_size ? "23/08/89" :
+                                                                  "23 Dec 6789, 23:59") +
                                    pad;
-  columns[COLUMN_SIZE].width = file_string_width(small_size ? "98.7 M" : "98.7 MB") + pad;
+  columns[COLUMN_SIZE].width = file_string_width(small_size ? "98.7 M" : "098.7 MB") + pad;
   if (params->display == FILE_IMGDISPLAY) {
     columns[COLUMN_NAME].width = ((float)params->thumbnail_size / 8.0f) * UI_UNIT_X;
   }
@@ -647,7 +648,7 @@ static void details_columns_init(const FileSelectParams *params, FileLayout *lay
   layout->details_columns[COLUMN_NAME].text_align = UI_STYLE_TEXT_LEFT;
   layout->details_columns[COLUMN_DATETIME].name = "Date Modified";
   layout->details_columns[COLUMN_DATETIME].sort_type = FILE_SORT_TIME;
-  layout->details_columns[COLUMN_DATETIME].text_align = UI_STYLE_TEXT_CENTER;
+  layout->details_columns[COLUMN_DATETIME].text_align = UI_STYLE_TEXT_LEFT;
   layout->details_columns[COLUMN_SIZE].name = "Size";
   layout->details_columns[COLUMN_SIZE].sort_type = FILE_SORT_SIZE;
   layout->details_columns[COLUMN_SIZE].text_align = UI_STYLE_TEXT_RIGHT;



More information about the Bf-blender-cvs mailing list