UI: show panel type in Python tooltips
authorCampbell Barton <ideasman42@gmail.com>
Wed, 19 Dec 2018 10:49:04 +0000 (21:49 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 19 Dec 2018 10:49:04 +0000 (21:49 +1100)
Handy when editing UI scripts.

source/blender/editors/interface/interface.c

index c63ffc87b8e2143d2e9dbe6bb4e3397e48f3952d..6dcee242f1e030762818c963ed3a8a4c7a040d01 100644 (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)) {