diff options
author | ack-err <ack-err> | 2013-09-13 13:07:40 +0400 |
---|---|---|
committer | ack-err <ack-err> | 2013-09-13 13:07:40 +0400 |
commit | 51fbcf519cd0944fe9d6d683cc63f83f8873062f (patch) | |
tree | 10d0f7fe57f16a7a7abd7dea8e7689d9e41223b5 | |
parent | 2750ec3d367586acebb19dd5e663fec868bd10fe (diff) |
Fixes a small bug whereby an RNA pointer was improperly created. Also removes the option to remove a button from a non-custom panel that was erroneously shown.
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/area.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index d5fa82161bc..954cbe65b66 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -5381,7 +5381,7 @@ static bool ui_but_menu(bContext *C, uiBut *but) Panel *pa = but->block->panel; /* Remove the operator from the custom enclosure */ - if (ar->regiontype == RGN_TYPE_TOOLS) { + if (ar->regiontype == RGN_TYPE_TOOLS && pa && pa->flag & PNL_CUSTOM_PANEL) { opp_but = uiDefIconTextBut(block, BUT, 0, ICON_NONE, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove From Panel"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 0f7f69ff685..e5e6f0306a1 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1886,8 +1886,10 @@ void static menubar_draw_oli(const bContext *C, uiLayout *row, OperatorListItem wmOperatorType *ot = WM_operatortype_find(oli->optype_idname, TRUE); int icon = ICON_NONE; PointerRNA ptr; + + WM_operator_properties_create_ptr(&ptr, ot); + ptr.data = oli->properties; - RNA_pointer_create(NULL, &RNA_Operator, oli->properties, &ptr); icon = ot->icon ? ot->icon(C, &ptr) : ot->default_icon; if (icon != ICON_NONE) |