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:
authorCampbell Barton <ideasman42@gmail.com>2020-04-15 05:42:01 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-04-15 06:04:13 +0300
commit92113e2da742e6b647578633a97ed6d16476fb97 (patch)
tree12d49c6cdd4914a70944acff91abd82213d7f625 /source/blender/editors/space_outliner
parentaf91bbc221fe21f9238172a8e152fe49dcd67d4b (diff)
Fix menu search omitting the outliner context menu
Use a regular context menu as a fallback for the outliner. If there are no specific actions for the item under the cursor, fall through to opening a regular menu. This lets menu search find the context menu items which were previously unavailable as menu search wont run operators.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index fe62272614f..d7b673c1b9e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -2332,11 +2332,9 @@ static int outliner_operator_menu(bContext *C, const char *opname)
uiLayoutSetOperatorContext(layout, WM_OP_INVOKE_REGION_WIN);
uiItemsEnumO(layout, ot->idname, RNA_property_identifier(ot->prop));
- MenuType *mt = WM_menutype_find("OUTLINER_MT_context", false);
- if (mt) {
- uiItemS(layout);
- UI_menutype_draw(C, mt, layout);
- }
+ uiItemS(layout);
+
+ uiItemMContents(layout, "OUTLINER_MT_context_menu");
UI_popup_menu_end(C, pup);
@@ -2471,14 +2469,8 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), const wmEvent
}
}
- /* Menus for clicking in empty space. */
- if (soops->outlinevis == SO_VIEW_LAYER) {
- WM_menu_name_call(C, "OUTLINER_MT_collection_new", WM_OP_INVOKE_REGION_WIN);
- return OPERATOR_FINISHED;
- }
-
- WM_menu_name_call(C, "OUTLINER_MT_context", WM_OP_INVOKE_REGION_WIN);
- return OPERATOR_FINISHED;
+ /* Let this fall through to 'OUTLINER_MT_context_menu'. */
+ return OPERATOR_PASS_THROUGH;
}
/* Menu only! Calls other operators */