UI: Use "label tooltip" as a fallback for quick favorites menu text

Useful when the button has no display text but has been set up
to have a quickly accessible tooltip in its place (for example
a brush asset item in the asset shelf).
This commit is contained in:
Hans Goudey 2024-05-01 12:53:53 -04:00
parent 09c0dec2a3
commit 14e8d0d9aa

@ -415,6 +415,10 @@ static void ui_but_user_menu_add(bContext *C, uiBut *but, bUserMenu *um)
STRNCPY(drawstr, idname);
#endif
}
else if (but->tip_label_func) {
/* The "quick tooltip" often contains a short string that can be used as a fallback. */
drawstr = but->tip_label_func(but);
}
}
ED_screen_user_menu_item_add_operator(
&um->items,