Fix [#20224] Moving to layer pannel missing shortcuts
authorMatt Ebb <matt@mke3.net>
Tue, 12 Jan 2010 02:13:20 +0000 (02:13 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 12 Jan 2010 02:13:20 +0000 (02:13 +0000)
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c

index 916a48b7442144e9802e8d7f9dd765619451754c..9fdb6a9fd9417e2224f398a11f3c0ba0efdb2937 100644 (file)
@@ -4819,9 +4819,16 @@ int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle *menu,
                                                        
                                                        if(but->type!=LABEL && but->type!=SEPR)
                                                                count++;
-
+                                                       
+                                                       /* exception for rna layer buts */
+                                                       if(but->rnapoin.data && but->rnaprop) {
+                                                               if (ELEM(RNA_property_subtype(but->rnaprop), PROP_LAYER, PROP_LAYER_MEMBER)) {
+                                                                       if (but->rnaindex== act-1)
+                                                                               doit=1;
+                                                               }
+                                                       }
                                                        /* exception for menus like layer buts, with button aligning they're not drawn in order */
-                                                       if(but->type==TOGR) {
+                                                       else if(but->type==TOGR) {
                                                                if(but->bitnr==act-1)
                                                                        doit= 1;
                                                        }
index 3a02b1f7e0c0c873b1d5ddf76c2cd7464ba53fe6..03422df9ba52e5d02fe775e85c7ca2f4811cc932 100644 (file)
@@ -1339,7 +1339,7 @@ uiPopupBlockHandle *ui_popup_block_create(bContext *C, ARegion *butregion, uiBut
                saferct= MEM_callocN(sizeof(uiSafetyRct), "uiSafetyRct");
                saferct->safety= block->safety;
                BLI_addhead(&block->saferct, saferct);
-               block->flag |= UI_BLOCK_POPUP;
+               block->flag |= UI_BLOCK_POPUP|UI_BLOCK_NUMSELECT;
        }
 
        /* the block and buttons were positioned in window space as in 2.4x, now