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:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-12-12 16:50:49 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-12-12 16:50:49 +0400
commit0ca46e3524ad74b4912b4cdfa8f27ae162e10257 (patch)
tree0c17c734cdf1d61a8e6672f9449620c6410e5e31
parentee62b20158f2322006b1b186024d888ec2175faf (diff)
Fix for menu context. The menu draw function context did not inherit the custom context storage from the original uiLayout yet. Fix by Campbell Barton (ideasman_42).
-rw-r--r--source/blender/editors/interface/interface_layout.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 9759c22f30e..c67c64a0540 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1466,7 +1466,13 @@ static void ui_item_menutype_func(bContext *C, uiLayout *layout, void *arg_mt)
printf("%s: opening menu \"%s\"\n", __func__, mt->idname);
}
+ if (layout->context)
+ CTX_store_set(C, layout->context);
+
mt->draw(C, &menu);
+
+ if (layout->context)
+ CTX_store_set(C, NULL);
}
static void ui_item_menu(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg, void *argN, const char *tip)