2.5
authorTon Roosendaal <ton@blender.org>
Thu, 4 Jun 2009 14:32:10 +0000 (14:32 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 4 Jun 2009 14:32:10 +0000 (14:32 +0000)
Two small fixes;
- Search menu options text could overlap with hotkey
- Operator "duplicate area into window" didnt work for non-actionzone

source/blender/editors/interface/interface_widgets.c
source/blender/editors/screen/screen_ops.c

index 47c4a7299567c27c24e088e49957df4019537084..628efa220edf6d1a17404cc91f771a597583a267 100644 (file)
@@ -1951,7 +1951,7 @@ void ui_draw_menu_item(uiFontStyle *fstyle, rcti *rect, char *name, int state)
        cpoin= strchr(name, '|');
        if(cpoin) {
                *cpoin= 0;
-               rect->xmax -= BLF_width(cpoin+1) -10;
+               rect->xmax -= BLF_width(cpoin+1) 10;
        }
        
        glColor3ubv(wt->wcol.text);
index e8314deeae907fe0894a30aea2646fa83cef0462..a61db5d5e1a48bc43f41ef890dab349b2c717a44 100644 (file)
@@ -608,18 +608,25 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event)
        bScreen *newsc, *sc;
        ScrArea *sa;
        rcti rect;
-       sActionzoneData *sad= event->customdata;
-
-       if(sad==NULL)
-               return OPERATOR_PASS_THROUGH;
        
        win= CTX_wm_window(C);
        sc= CTX_wm_screen(C);
-       sa= sad->sa1;
+       sa= CTX_wm_area(C);
+       
+       /* XXX hrmf! */
+       if(event->type==EVT_ACTIONZONE_AREA) {
+               sActionzoneData *sad= event->customdata;
 
+               if(sad==NULL)
+                       return OPERATOR_PASS_THROUGH;
+       
+               sa= sad->sa1;
+       }
+       
        /*  poll() checks area context, but we don't accept full-area windows */
        if(sc->full != SCREENNORMAL) {
-               actionzone_exit(C, op);
+               if(event->type==EVT_ACTIONZONE_AREA)
+                       actionzone_exit(C, op);
                return OPERATOR_CANCELLED;
        }
        
@@ -638,7 +645,8 @@ static int area_dupli_invoke(bContext *C, wmOperator *op, wmEvent *event)
        /* screen, areas init */
        WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL);
 
-       actionzone_exit(C, op);
+       if(event->type==EVT_ACTIONZONE_AREA)
+               actionzone_exit(C, op);
        
        return OPERATOR_FINISHED;
 }