Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-04-26 23:23:52 +0300
committerJulian Eisel <julian@blender.org>2022-04-26 23:23:52 +0300
commit5fe1624b0eba8267325f166de8e75c4d2dd6989b (patch)
treed7ea9f084ba06a11bd0bd97490b00825fefaaf94 /source/blender/editors/include/UI_interface.h
parent8016d8a4bd21b2c113f0e2c9252d658cd48a5bd8 (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/UI_interface.h')
-rw-r--r--source/blender/editors/include/UI_interface.h7
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);