Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Tue, 31 Jul 2018 00:42:19 +0000 (10:42 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 31 Jul 2018 00:42:19 +0000 (10:42 +1000)
1  2 
source/blender/editors/interface/interface_context_menu.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_query.c

index 240649c8ab04f6e94d05f9c1f7bfcc57123779b1,54e755f6cc64f3fe7c9d23ba9544e88bbea7c7e3..d00ab70562c727874677c2ff26f1b7c56bb1ffae
@@@ -687,35 -532,8 +687,35 @@@ bool ui_popup_context_menu_for_button(b
                uiItemS(layout);
        }
  
 +      /* Favorites Menu */
 +      if (ui_but_is_user_menu_compatible(C, but)) {
 +              uiBlock *block = uiLayoutGetBlock(layout);
 +              const int w = uiLayoutGetWidth(layout);
 +              uiBut *but2;
 +
 +              but2 = uiDefIconTextBut(
 +                      block, UI_BTYPE_BUT, 0, ICON_MENU_PANEL,
 +                      CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Add to Favorites Menu"),
 +                      0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0,
 +                      "Add to a user defined context menu (stored in the user preferences)");
 +              UI_but_func_set(but2, popup_user_menu_add_or_replace_func, but, NULL);
 +
 +              bUserMenu *um = ED_screen_user_menu_find(C);
 +              if (um) {
 +                      bUserMenuItem *umi = ui_but_user_menu_find(C, but, um);
 +                      if (umi != NULL) {
 +                              but2 = uiDefIconTextBut(
 +                                      block, UI_BTYPE_BUT, 0, ICON_CANCEL,
 +                                      CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Remove from Favorites Menu"),
 +                                      0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
 +                              UI_but_func_set(but2, popup_user_menu_remove_func, um, umi);
 +                      }
 +              }
 +              uiItemS(layout);
 +      }
 +
        /* Show header tools for header buttons. */
-       if (ui_block_is_menu(but->block) == false) {
+       if (ui_block_is_popup_any(but->block) == false) {
                ARegion *ar = CTX_wm_region(C);
                if (ar && (ar->regiontype == RGN_TYPE_HEADER)) {
                        uiItemMenuF(layout, IFACE_("Header"), ICON_NONE, ED_screens_header_tools_menu_create, NULL);