Fix empty name shown for operators opening menus without a title
For some cases like the edit mode context menu we don't currently have a fixed title since it's dynamic. This should be improved, but we should at least still show Call Menu if there is no menu title.
This commit is contained in:
@@ -586,12 +586,13 @@ static void wm_operatortype_free_macro(wmOperatorType *ot)
|
||||
|
||||
const char *WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
|
||||
{
|
||||
const char *name = NULL;
|
||||
|
||||
if (ot->get_name && properties) {
|
||||
return ot->get_name(ot, properties);
|
||||
}
|
||||
else {
|
||||
return RNA_struct_ui_name(ot->srna);
|
||||
name = ot->get_name(ot, properties);
|
||||
}
|
||||
|
||||
return (name && name[0]) ? name : RNA_struct_ui_name(ot->srna);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
Reference in New Issue
Block a user