From 5bcb0c9935033d9d9983838bd4f5ed226627c2e9 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Mon, 25 Nov 2019 19:41:30 +0100 Subject: UI: Allow label for Template-ID (respecting property split layout) Adds a `text` parameter to `bpy.types.uiLayout.template_ID()` which causes a label to be added, as usual. Adding the label also makes the template respect the `bpy.types.uiLayout.use_property_split` option. Also fixes wrong layout being used in the template-ID, although I think that didn't cause issues in practice. Sergey requested this for usage in the Movie Clip Editor. --- source/blender/editors/include/UI_interface.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 69229f25917..b81fa4ae483 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1875,7 +1875,8 @@ void uiTemplateID(uiLayout *layout, const char *openop, const char *unlinkop, int filter, - const bool live_icon); + const bool live_icon, + const char *text); void uiTemplateIDBrowse(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, @@ -1883,7 +1884,8 @@ void uiTemplateIDBrowse(uiLayout *layout, const char *newop, const char *openop, const char *unlinkop, - int filter); + int filter, + const char *text); void uiTemplateIDPreview(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, @@ -2270,6 +2272,7 @@ void uiItemsFullEnumO_items(uiLayout *layout, int totitem); void uiItemL(uiLayout *layout, const char *name, int icon); /* label */ +uiLayout *uiItemL_respect_property_split(uiLayout *layout, const char *text, int icon); /* label icon for dragging */ void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon); /* menu */ -- cgit v1.2.3