Show tool title for favorites menu
authorPhilipp Oeser <info@graphics-engineer.com>
Tue, 4 Dec 2018 05:14:21 +0000 (16:14 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 4 Dec 2018 05:14:21 +0000 (16:14 +1100)
source/blender/editors/interface/interface_context_menu.c

index 111aa64e771b9633c8d85933717c0df10967fa30..bbc0f66605c12ed71b11a09e9c0f23ad4c3c61b7 100644 (file)
@@ -275,6 +275,12 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
 
        MenuType *mt = NULL;
        if (but->optype) {
+               if (drawstr[0] == '\0') {
+                       /* Hard code overrides for generic operators. */
+                       if (UI_but_is_tool(but)) {
+                               RNA_string_get(but->opptr, "name", drawstr);
+                       }
+               }
                ED_screen_user_menu_item_add_operator(
                        &um->items, drawstr,
                        but->optype, but->opptr ? but->opptr->data : NULL, but->opcontext);