diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-08 03:10:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-08 03:38:19 +0300 |
commit | 8c539b0ab521d442d88c70243c04cbb9e40fe412 (patch) | |
tree | 58b1ffb19b1117404698a6705a87406722400b01 /source/blender/editors/space_file/filelist.c | |
parent | c56c493cf403b63ec46b90023cdc8137275a310f (diff) |
Font preview for file browser
D1002 by @plasmasolutions, with own refactoring.
Note, needed to do a bad-level call here (IMB -> BLF)
Also can't use the BLF API directly because its not thread-safe.
So keep the function isolated (blf_thumbs.c).
Diffstat (limited to 'source/blender/editors/space_file/filelist.c')
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 66acd7d05e3..5214b611fb9 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1348,6 +1348,9 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float limg->flags |= FILE_TYPE_MOVIE_ICON; } } + else if (limg->flags & FILE_TYPE_FTFONT) { + limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_FONT); + } *do_update = true; PIL_sleep_ms(10); limg = limg->next; @@ -1363,7 +1366,7 @@ static void thumbnails_update(void *tjv) while (limg) { if (!limg->done && limg->img) { tj->filelist->filelist[limg->index].image = IMB_dupImBuf(limg->img); - /* update flag for movie files where thumbnail can't be created */ + /* update flag for movie and font files where thumbnail can't be created */ if (limg->flags & FILE_TYPE_MOVIE_ICON) { tj->filelist->filelist[limg->index].flags &= ~FILE_TYPE_MOVIE; tj->filelist->filelist[limg->index].flags |= FILE_TYPE_MOVIE_ICON; @@ -1408,7 +1411,7 @@ void thumbnails_start(FileList *filelist, const bContext *C) continue; } if (!filelist->filelist[idx].image) { - if (filelist->filelist[idx].flags & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | + if (filelist->filelist[idx].flags & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT | FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) { FileImage *limg = MEM_callocN(sizeof(*limg), __func__); |