For all buttons with search-menu option, the button will show a

red-alert drawing when input doesn't exist. Will help debugging
when messing with uv-layer names, vertex groups, etc.

Also closes bugreport #24905
This commit is contained in:
2010-11-29 15:25:06 +00:00
parent 8272ec2302
commit 1c0d7d6815
3 changed files with 41 additions and 3 deletions

View File

@@ -3394,6 +3394,7 @@ uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxle
return but;
}
/* arg is user value, searchfunc and handlefunc both get it as arg */
/* if active set, button opens with this item visible and selected */
void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandleFunc bfunc, void *active)
@@ -3402,6 +3403,13 @@ void uiButSetSearchFunc(uiBut *but, uiButSearchFunc sfunc, void *arg, uiButHandl
but->search_arg= arg;
uiButSetFunc(but, bfunc, arg, active);
/* search buttons show red-alert if item doesn't exist, not for menus */
if(0==(but->block->flag & UI_BLOCK_LOOP)) {
/* skip empty buttons, not all buttons need input, we only show invalid */
if(but->drawstr[0])
ui_but_search_test(but);
}
}
/* Program Init/Exit */