diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-05-17 01:34:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-05-17 01:34:22 +0400 |
commit | 4100695f38e6d62f2c6a5509a7d4b1a4cc13a617 (patch) | |
tree | 31b8819ec68cf560552016d83981546459a62a66 /source/blender/src/toolbox.c | |
parent | 9b2dcab02d17773e6673f11771bf0e5c3554c439 (diff) |
root level python tree menu's didnt work with seperators, would display SEPR text instead
Diffstat (limited to 'source/blender/src/toolbox.c')
-rw-r--r-- | source/blender/src/toolbox.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index c7a9147d015..94d38ee1635 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -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); |