Ctrl-0 can now be used to just reset a single component of an array to

its default value instead of resetting the entire array
This commit is contained in:
2011-02-15 00:53:20 +00:00
parent d4ebace149
commit dab76a3ccf
3 changed files with 7 additions and 4 deletions

View File

@@ -1773,11 +1773,13 @@ int ui_set_but_string(bContext *C, uiBut *but, const char *str)
return 0;
}
void ui_set_but_default(bContext *C, uiBut *but)
void ui_set_but_default(bContext *C, uiBut *but, short all)
{
/* if there is a valid property that is editable... */
if (but->rnapoin.data && but->rnaprop && RNA_property_editable(&but->rnapoin, but->rnaprop)) {
if(RNA_property_reset(&but->rnapoin, but->rnaprop, -1)) {
int index = (all)? -1 : but->rnaindex;
if(RNA_property_reset(&but->rnapoin, but->rnaprop, index)) {
/* perform updates required for this property */
RNA_property_update(C, &but->rnapoin, but->rnaprop);
}