UI: New button/widget type for Asset Browser like preview tiles

This button type shows a preview image above centered text, similar to
the File Browser files in Thumbnail Display Mode or the default Asset
Browser display. In fact we may want to port these over to use the new
button type at some point.

Will be used by the asset view UI template that will be added in a
following commit. That is basically a mini version of the Asset Browser
that can be displayed elsewhere in the UI.
This commit is contained in:
2021-07-13 17:30:34 +02:00
committed by Sybren A. Stüvel
parent 0c83ef567c
commit bc4f99aa86
5 changed files with 78 additions and 21 deletions

View File

@@ -599,8 +599,12 @@ static void ui_searchbox_region_draw_cb(const bContext *C, ARegion *region)
ui_searchbox_butrect(&rect, data, a);
/* widget itself */
ui_draw_preview_item(
&data->fstyle, &rect, data->items.names[a], data->items.icons[a], state);
ui_draw_preview_item(&data->fstyle,
&rect,
data->items.names[a],
data->items.icons[a],
state,
UI_STYLE_TEXT_LEFT);
}
/* indicate more */