UI: show panel type in Python tooltips

Handy when editing UI scripts.
This commit is contained in:
Campbell Barton 2018-12-19 21:49:04 +11:00
parent 543a34a021
commit 1a21c0c239
1 changed files with 8 additions and 1 deletions

View File

@ -4765,8 +4765,15 @@ void UI_but_string_info_get(bContext *C, uiBut *but, ...)
tmp = BLI_strdup(but->optype->idname);
else if (ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_PULLDOWN)) {
MenuType *mt = UI_but_menutype_get(but);
if (mt)
if (mt) {
tmp = BLI_strdup(mt->idname);
}
}
else if (but->type == UI_BTYPE_POPOVER) {
PanelType *pt = UI_but_paneltype_get(but);
if (pt) {
tmp = BLI_strdup(pt->idname);
}
}
}
else if (ELEM(type, BUT_GET_RNA_LABEL, BUT_GET_RNA_TIP)) {