[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59607] branches/soc-2013-ui_replay/source /blender/editors/interface/interface_handlers.c: Added the option to remove operator buttons from the menubar in the right click menu .

Vincent Akkermans vincent at ack-err.net
Wed Aug 28 17:58:37 CEST 2013


Revision: 59607
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59607
Author:   ack-err
Date:     2013-08-28 15:58:36 +0000 (Wed, 28 Aug 2013)
Log Message:
-----------
Added the option to remove operator buttons from the menubar in the right click menu.

Modified Paths:
--------------
    branches/soc-2013-ui_replay/source/blender/editors/interface/interface_handlers.c

Modified: branches/soc-2013-ui_replay/source/blender/editors/interface/interface_handlers.c
===================================================================
--- branches/soc-2013-ui_replay/source/blender/editors/interface/interface_handlers.c	2013-08-28 15:25:01 UTC (rev 59606)
+++ branches/soc-2013-ui_replay/source/blender/editors/interface/interface_handlers.c	2013-08-28 15:58:36 UTC (rev 59607)
@@ -4969,6 +4969,16 @@
 	BLI_freelinkN(&pa->operators, oli);
 }
 
+static void remove_from_menu_bar(bContext *UNUSED(C), void *arg_ar, void *arg_optype)
+{
+	ARegion *ar = arg_ar;
+	wmOperatorType *ot = arg_optype;
+	OperatorListItem *oli;
+	
+	oli = BLI_findstring(&ar->operators, ot->idname, offsetof(OperatorListItem, optype_idname));
+	BLI_freelinkN(&ar->operators, oli);
+}
+
 static bool ui_but_menu(bContext *C, uiBut *but)
 {
 	uiPopupMenu *pup;
@@ -5227,12 +5237,12 @@
 			
 			/* Remove the operator from the custom enclosure */
 			if (ar->regiontype == RGN_TYPE_TOOLS) {
-				
 				opp_but = uiDefIconTextBut(block, BUT, 0, ICON_NONE, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove From Custom Panel"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
 				uiButSetFunc(opp_but, remove_from_custom_panel, pa, but->optype);
 			}
 			else if (ar->regiontype == RGN_TYPE_MENU_BAR) {
-				
+				opp_but = uiDefIconTextBut(block, BUT, 0, ICON_NONE, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Remove From Menu Bar"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
+				uiButSetFunc(opp_but, remove_from_menu_bar, ar, but->optype);
 			}
 			
 			opp_but = uiDefIconTextBut(block, BUT, 0, ICON_NONE, CTX_IFACE_(BLF_I18NCONTEXT_OPERATOR_DEFAULT, "Add to Icon Shelf"), 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");




More information about the Bf-blender-cvs mailing list