From 054aa61f3c9af0997cbb0ecf89f73227723a24cd Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 29 Apr 2015 21:25:34 +0200 Subject: File browser - change thumbnails size with a slider We can now scale from 32px up to 256px (default has been upgraded to 128px). Thumbnails are now generated as 'large', i.e. 256px. Previews are scaled up if necessary, unlike icons (for folders or files without preview images). Note that .blend thumbnails themselves remain in 128px for now (they are embeded in .blend files, not quite sure we want to make them four times bigger...). Patch by DMS (Yaron Dames), with final edits by myself. Reviewers: mont29 Subscribers: Severin, mont29 Differential Revision: https://developer.blender.org/D1260 --- source/blender/editors/space_file/filesel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_file/filesel.c') diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 6858f536e92..d89e55cb55f 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -102,6 +102,8 @@ short ED_fileselect_set_params(SpaceFile *sfile) /* set path to most recently opened .blend */ BLI_split_dirfile(G.main->name, sfile->params->dir, sfile->params->file, sizeof(sfile->params->dir), sizeof(sfile->params->file)); sfile->params->filter_glob[0] = '\0'; + /* set the default thumbnails size */ + sfile->params->thumbnails_size = 128; } params = sfile->params; @@ -527,8 +529,8 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *ar) layout->textheight = textheight; if (params->display == FILE_IMGDISPLAY) { - layout->prv_w = 4.8f * UI_UNIT_X; - layout->prv_h = 4.8f * UI_UNIT_Y; + layout->prv_w = ((float)params->thumbnails_size / 20.0f) * UI_UNIT_X; + layout->prv_h = ((float)params->thumbnails_size / 20.0f) * UI_UNIT_Y; layout->tile_border_x = 0.3f * UI_UNIT_X; layout->tile_border_y = 0.3f * UI_UNIT_X; layout->prv_border_x = 0.3f * UI_UNIT_X; -- cgit v1.2.3