diff options
author | Julian Eisel <julian@blender.org> | 2022-04-26 23:23:52 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-04-26 23:23:52 +0300 |
commit | 5fe1624b0eba8267325f166de8e75c4d2dd6989b (patch) | |
tree | d7ea9f084ba06a11bd0bd97490b00825fefaaf94 /source/blender/editors/include | |
parent | 8016d8a4bd21b2c113f0e2c9252d658cd48a5bd8 (diff) |
UI: Support setting context for buttons without layout
It was possible to set context pointers for buttons via the layout, but
not for buttons in places where the layout system wasn't used (where
buttons are placed manually). This is needed for buttons in the
Outliner, see D14653.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 3f58aab3e53..94453ef5fac 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1360,6 +1360,13 @@ uiBut *uiDefIconTextButO_ptr(uiBlock *block, /* for passing inputs to ButO buttons */ struct PointerRNA *UI_but_operator_ptr_get(uiBut *but); +void UI_but_context_ptr_set(uiBlock *block, + uiBut *but, + const char *name, + const struct PointerRNA *ptr); +const struct PointerRNA *UI_but_context_ptr_get(const uiBut *but, + const char *name, + const StructRNA *type CPP_ARG_DEFAULT(nullptr)); struct bContextStore *UI_but_context_get(const uiBut *but); void UI_but_unit_type_set(uiBut *but, int unit_type); |