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:
Julian Eisel 2019-09-02 15:30:56 +02:00
parent 591db72ee2
commit 2356f60c62
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}