[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59608] branches/soc-2013-ui_replay/source /blender/editors/interface/interface_handlers.c: A bit of cleanup and an extra check so that the option to remove a button does not show up for normal menu entries .

Vincent Akkermans vincent at ack-err.net
Wed Aug 28 18:03:57 CEST 2013


Revision: 59608
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59608
Author:   ack-err
Date:     2013-08-28 16:03:56 +0000 (Wed, 28 Aug 2013)
Log Message:
-----------
A bit of cleanup and an extra check so that the option to remove a button does not show up for normal menu entries.

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:58:36 UTC (rev 59607)
+++ branches/soc-2013-ui_replay/source/blender/editors/interface/interface_handlers.c	2013-08-28 16:03:56 UTC (rev 59608)
@@ -5237,12 +5237,15 @@
 			
 			/* 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, "");
+				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, "");
 				uiButSetFunc(opp_but, remove_from_custom_panel, pa, but->optype);
+				uiItemS(layout);
 			}
-			else if (ar->regiontype == RGN_TYPE_MENU_BAR) {
+			else if (ar->regiontype == RGN_TYPE_MENU_BAR && BLI_findstring(&ar->operators, but->optype->idname
+, offsetof(OperatorListItem, optype_idname)) != NULL) {
 				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);
+				uiItemS(layout);
 			}
 			
 			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