Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2019-09-02 16:30:56 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-09-02 16:41:46 +0300
commit2356f60c6200188a2f88d6d890ff78fa8fd2b4d3 (patch)
tree6d8ca2257573b1cbc534722277ac1b013a311f40
parent591db72ee2ee4c731968754f0be288e9222c012d (diff)
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.
-rw-r--r--source/blender/editors/interface/interface_context_menu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index 970c9e31c50..580ff527bf6 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -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;
}