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-01-28 18:42:23 +0300
committerJulian Eisel <julian@blender.org>2022-01-28 18:53:37 +0300
commit92d747b0c46e2645b7308edd31c778634c68c2c5 (patch)
tree0516b51e31fbd2c95c57d2d42cde12f6c4d1e7cf /source/blender/editors/interface
parent4e93918b35facdc1ef8aa84d234c0687418006e2 (diff)
Drag & drop: Support using context of hovered button when dropping
Buttons can hold context and it's very useful to use this as a way to let buttons provide context for drop operators. For example, with this D13549 can make the material slot list set the material-slot pointer for each row, and the drop operator can just query that.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 636281ba373..2292bf759b7 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -5928,6 +5928,11 @@ PointerRNA *UI_but_operator_ptr_get(uiBut *but)
return but->opptr;
}
+bContextStore *UI_but_context_get(const uiBut *but)
+{
+ return but->context;
+}
+
void UI_but_unit_type_set(uiBut *but, const int unit_type)
{
but->unit_type = (uchar)(RNA_SUBTYPE_UNIT_VALUE(unit_type));