Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-11-18 13:23:15 +0300
committerJulian Eisel <julian@blender.org>2021-11-18 13:47:21 +0300
commite5774282b94772af8822f4e3ab8b24207a450fb8 (patch)
treede686b5cdabb16597a7d4d06c22e16f80169cd8b /source/blender/editors/space_file
parent8c0370ef7b8d2854ca6eac8f57c626bb3c4b2f2b (diff)
Fix asset preview not showing up for current file data-blocks
For data-blocks from the current file, the image-buffer for dragging wasn't set at all. This wasn't intentional, dragging things in the Asset Browser should just always show the preview.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_draw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 66aabe39e44..e393cc41a86 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -178,6 +178,10 @@ static void file_draw_icon(const SpaceFile *sfile,
if ((id = filelist_file_get_id(file))) {
UI_but_drag_set_id(but, id);
+ ImBuf *preview_image = filelist_file_getimage(file);
+ if (preview_image) {
+ UI_but_drag_attach_image(but, preview_image, UI_DPI_FAC);
+ }
}
else if (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS &&
(file->typeflag & FILE_TYPE_ASSET) != 0) {
@@ -504,6 +508,7 @@ static void file_draw_preview(const SpaceFile *sfile,
if ((id = filelist_file_get_id(file))) {
UI_but_drag_set_id(but, id);
+ UI_but_drag_attach_image(but, imb, scale);
}
/* path is no more static, cannot give it directly to but... */
else if (sfile->browse_mode == FILE_BROWSE_MODE_ASSETS &&