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:
authorDalai Felinto <dfelinto@gmail.com>2019-03-15 16:49:26 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-03-15 16:53:35 +0300
commit2e043c266bfff4b0de7c1cb2b324549cdf5a742b (patch)
treee206963fcb6cd990e87693f0a1634ec2044fa7f2 /source/blender/editors/interface/interface_context_menu.c
parentd5d518b96c16bb36342d99f63aa7d1569e650cdf (diff)
Fix: "Jump To Target" showing up in workspace context menu
Issue introduced on d227c58e3ec2020. This was affecting WorkSpaces as well as background scene and probably other places. We use the operator poll to decide whether to show it. Reviewers: brecht, mont29 Differential Revision: https://developer.blender.org/D4488
Diffstat (limited to 'source/blender/editors/interface/interface_context_menu.c')
-rw-r--r--source/blender/editors/interface/interface_context_menu.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index d075052f842..5c870e6a281 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -678,9 +678,13 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
/* Pointer properties and string properties with
* prop_search support jumping to target object/bone. */
if (but->rnapoin.data && but->rnaprop) {
- const PropertyType type = RNA_property_type(but->rnaprop);
-
- if ((type == PROP_POINTER) || (type == PROP_STRING && but->type == UI_BTYPE_SEARCH_MENU && but->search_func == ui_rna_collection_search_cb)) {
+ const PropertyType prop_type = RNA_property_type(but->rnaprop);
+ if (((prop_type == PROP_POINTER) ||
+ (prop_type == PROP_STRING &&
+ but->type == UI_BTYPE_SEARCH_MENU &&
+ but->search_func == ui_rna_collection_search_cb)) &&
+ ui_jump_to_target_button_poll(C))
+ {
uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Jump To Target"),
ICON_NONE, "UI_OT_jump_to_target_button");
uiItemS(layout);