UI: Don't show button context menu for drag-labels
While the vast majority of labels would never get a button context menu (as opposed to the regular context menu of this region), draggable labels would still reach code for such context menu creation. From what I can tell only file browser icons/thumbnails and the properties editor data path would be affected. The button context menu doesn't make sense for them, so let the region context menu show up instead. If at some point we want button context menus for specific labels, we can make checks more granular.
This commit is contained in:
parent
591db72ee2
commit
2356f60c62
|
@ -490,8 +490,9 @@ static void ui_but_menu_add_path_operators(uiLayout *layout, PointerRNA *ptr, Pr
|
|||
|
||||
bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
|
||||
{
|
||||
/* having this menu for some buttons makes no sense */
|
||||
if (but->type == UI_BTYPE_IMAGE) {
|
||||
/* ui_but_is_interactive() may let some buttons through that should not get a context menu - it
|
||||
* doesn't make sense for them. */
|
||||
if (ELEM(but->type, UI_BTYPE_LABEL, UI_BTYPE_IMAGE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue