diff options
author | Julian Eisel <julian@blender.org> | 2021-06-29 18:20:33 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-06-29 19:20:56 +0300 |
commit | 2ff714269e53f9a744242cd6c039ec65a47ec7ec (patch) | |
tree | 9c045b9cf56f50a86b7af87bc56a5495813f2e70 /source/blender/editors/include/UI_interface.h | |
parent | 63aa6dd845ebdb0f62c95a720e82e554c0208d95 (diff) |
UI: Support setting operator properties for `UILayout.operator_menu_enum()`
`UILayout.operator_menu_enum()` now returns the operator properties, just like
`UILayout.operator()`. This makes it possible to set options for the operator
displayed in the menu. In C it can be done through the new
`uiItemMenuEnumFullO()` or `uiItemMenuEnumFullO_ptr()`.
It's reasonable to have this, probably just a small thing never bothered to
add. D10912 could use it, the following comment can be addressed now too:
https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_nla/nla_buttons.c$583-586
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index b8443b952a8..b23f3e29551 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -2425,12 +2425,20 @@ void uiItemPopoverPanelFromGroup(uiLayout *layout, void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg); void uiItemMenuFN(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *argN); -void uiItemMenuEnumO_ptr(uiLayout *layout, +void uiItemMenuEnumFullO_ptr(uiLayout *layout, + struct bContext *C, + struct wmOperatorType *ot, + const char *propname, + const char *name, + int icon, + struct PointerRNA *r_opptr); +void uiItemMenuEnumFullO(uiLayout *layout, struct bContext *C, - struct wmOperatorType *ot, + const char *opname, const char *propname, const char *name, - int icon); + int icon, + struct PointerRNA *r_opptr); void uiItemMenuEnumO(uiLayout *layout, struct bContext *C, const char *opname, |