Asset Template: Extra UI options

This allow users to show/hide:
* Library name / refresh.
* Assets names.
* Filter.

To set them in Python use:
display_options={'NO_NAMES', 'NO_FILTER', 'NO_LIBRARY'}

With contributions by Julian Eisel.

Differential Revision: https://developer.blender.org/D12476
This commit is contained in:
Dalai Felinto
2021-09-13 18:40:21 +02:00
parent 9fe6854a93
commit 3ff60bcad8
5 changed files with 77 additions and 9 deletions

View File

@@ -2209,6 +2209,11 @@ enum uiTemplateListFlags {
UI_TEMPLATE_LIST_SORT_LOCK = (1 << 1),
/* Don't allow resizing the list, i.e. don't add the grip button. */
UI_TEMPLATE_LIST_NO_GRIP = (1 << 2),
/** Do not show filtering options, not even the button to expand/collapse them. Also hides the
* grip button. */
UI_TEMPLATE_LIST_NO_FILTER_OPTIONS = (1 << 3),
/** For #UILST_LAYOUT_BIG_PREVIEW_GRID, don't reserve space for the name label. */
UI_TEMPLATE_LIST_NO_NAMES = (1 << 4),
UI_TEMPLATE_LIST_FLAGS_LAST
};
@@ -2289,6 +2294,12 @@ int uiTemplateRecentFiles(struct uiLayout *layout, int rows);
void uiTemplateFileSelectPath(uiLayout *layout,
struct bContext *C,
struct FileSelectParams *params);
enum {
UI_TEMPLATE_ASSET_DRAW_NO_NAMES = (1 << 0),
UI_TEMPLATE_ASSET_DRAW_NO_FILTER = (1 << 1),
UI_TEMPLATE_ASSET_DRAW_NO_LIBRARY = (1 << 2),
};
void uiTemplateAssetView(struct uiLayout *layout,
struct bContext *C,
const char *list_id,
@@ -2299,6 +2310,7 @@ void uiTemplateAssetView(struct uiLayout *layout,
struct PointerRNA *active_dataptr,
const char *active_propname,
const struct AssetFilterSettings *filter_settings,
const int display_flags,
const char *activate_opname,
struct PointerRNA *r_activate_op_properties,
const char *drag_opname,