UI: decorator color button assert

Also set 'all' argument based on the RNA-index
(even though it worked, better set to correct value).
This commit is contained in:
Campbell Barton 2018-06-17 12:13:14 +02:00
parent ab20901c9e
commit e960920f2f
2 changed files with 3 additions and 3 deletions

View File

@ -337,7 +337,7 @@ void ui_but_anim_decorate_cb(bContext *C, void *arg_but, void *UNUSED(arg_dummy)
PointerRNA props_ptr;
wmOperatorType *ot = WM_operatortype_find("ANIM_OT_keyframe_delete_button", false);
WM_operator_properties_create_ptr(&props_ptr, ot);
RNA_boolean_set(&props_ptr, "all", false);
RNA_boolean_set(&props_ptr, "all", but->rnaindex == -1);
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &props_ptr);
WM_operator_properties_free(&props_ptr);
}
@ -345,7 +345,7 @@ void ui_but_anim_decorate_cb(bContext *C, void *arg_but, void *UNUSED(arg_dummy)
PointerRNA props_ptr;
wmOperatorType *ot = WM_operatortype_find("ANIM_OT_keyframe_insert_button", false);
WM_operator_properties_create_ptr(&props_ptr, ot);
RNA_boolean_set(&props_ptr, "all", false);
RNA_boolean_set(&props_ptr, "all", but->rnaindex == -1);
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &props_ptr);
WM_operator_properties_free(&props_ptr);
}

View File

@ -1724,7 +1724,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
BLI_insertlinkafter(&block->buttons, but_decorate, but);
but_decorate = but->next;
}
BLI_assert(len ? i == len : i == 1);
BLI_assert(len ? (ELEM(i, 1, len)) : i == 1);
}
#endif /* UI_PROP_DECORATE */