root level python tree menu's didnt work with seperators, would display SEPR text...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 16 May 2008 21:34:22 +0000 (21:34 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 16 May 2008 21:34:22 +0000 (21:34 +0000)
source/blender/src/toolbox.c

index c7a9147d015f7129e20c4011c5db29ec6cc174e2..94d38ee16353e9d24c277b33554d0287b467dfff 100644 (file)
@@ -2298,16 +2298,21 @@ void toolbox_generic( TBitem *generic_menu )
        
        /* Add the menu */
        for (menu = generic_menu; menu->icon != -1; menu++) {
-               if (menu->poin) {
-                       but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
-                       uiButSetFlag(but, UI_MAKE_RIGHT);
-                       
-                       uiButSetFunc(but, store_main, (void *)+32, (void *)ypos);
+               if(strcmp(menu->name, "SEPR")==0) {
+                       uiDefBut(block, SEPR, 0, "", mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 6, NULL, 0.0, 0.0, 0, 0, "");
+                       ypos-=6;
                } else {
-                       /* TODO - add icon support */
-                       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, menu->retval, "");
+                        if (menu->poin) {
+                               but=uiDefIconTextBlockBut(block, tb_makemenu, menu->poin, ICON_RIGHTARROW_THIN, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, "");
+                               uiButSetFlag(but, UI_MAKE_RIGHT);
+                       
+                               uiButSetFunc(but, store_main, (void *)+32, (void *)ypos);
+                       } else {
+                               /* TODO - add icon support */
+                               uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, menu->name, mval[0]+tb_mainx,mval[1]+tb_mainy+ypos+5, dx, 19, NULL, 0.0, 0.0, 0, menu->retval, "");
+                       }
+                       ypos-=20;
                }
-               ypos-=20;
        }
        
        uiBlockSetButmFunc(block, menu->poin, NULL);