Cleanup: Avoid mixing unlink-operator and menu name for ID-templates

The context menu name for `UILayout.template_ID_tabs()` would be passed
through multiple functions as `unlinkop`.
This commit is contained in:
Julian Eisel 2020-05-26 13:24:28 +02:00
parent 13e17cbd47
commit 23520cbd13
1 changed files with 10 additions and 3 deletions

View File

@ -1220,6 +1220,8 @@ static void ui_template_id(uiLayout *layout,
const char *newop,
const char *openop,
const char *unlinkop,
/* Only respected by tabs (use_tabs). */
const char *menu,
const char *text,
int flag,
int prv_rows,
@ -1274,7 +1276,7 @@ static void ui_template_id(uiLayout *layout,
if (template_ui->idlb) {
if (use_tabs) {
layout = uiLayoutRow(layout, true);
template_ID_tabs(C, layout, template_ui, type, flag, newop, unlinkop);
template_ID_tabs(C, layout, template_ui, type, flag, newop, menu);
}
else {
layout = uiLayoutRow(layout, true);
@ -1313,6 +1315,7 @@ void uiTemplateID(uiLayout *layout,
newop,
openop,
unlinkop,
NULL,
text,
UI_ID_BROWSE | UI_ID_RENAME | UI_ID_DELETE,
0,
@ -1341,6 +1344,7 @@ void uiTemplateIDBrowse(uiLayout *layout,
newop,
openop,
unlinkop,
NULL,
text,
UI_ID_BROWSE | UI_ID_RENAME,
0,
@ -1372,6 +1376,7 @@ void uiTemplateIDPreview(uiLayout *layout,
openop,
unlinkop,
NULL,
NULL,
UI_ID_BROWSE | UI_ID_RENAME | UI_ID_DELETE | UI_ID_PREVIEWS,
rows,
cols,
@ -1399,6 +1404,7 @@ void uiTemplateGpencilColorPreview(uiLayout *layout,
NULL,
NULL,
NULL,
NULL,
UI_ID_BROWSE | UI_ID_PREVIEWS | UI_ID_DELETE,
rows,
cols,
@ -1417,7 +1423,7 @@ void uiTemplateIDTabs(uiLayout *layout,
PointerRNA *ptr,
const char *propname,
const char *newop,
const char *unlinkop,
const char *menu,
int filter)
{
ui_template_id(layout,
@ -1426,7 +1432,8 @@ void uiTemplateIDTabs(uiLayout *layout,
propname,
newop,
NULL,
unlinkop,
NULL,
menu,
NULL,
UI_ID_BROWSE | UI_ID_RENAME,
0,