2.5 / Nodes
authorNathan Letwory <nathan@letworyinteractive.com>
Thu, 1 Jan 2009 20:08:57 +0000 (20:08 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Thu, 1 Jan 2009 20:08:57 +0000 (20:08 +0000)
* zoom in/out added also as menu entry
* view all operator is now only executed, not invoked.

source/blender/editors/space_node/node_header.c
source/blender/editors/space_node/node_state.c

index 26abfe0..dfe155b 100644 (file)
@@ -591,12 +591,14 @@ static void do_node_viewmenu(bContext *C, void *arg, int event)
        ScrArea *sa= CTX_wm_area(C);
        
        switch(event) {
-               /* cases 1 and 2 are now handled automagically by View2D code */
                case 1: /* Zoom in */
+                       WM_operator_name_call(C, "View2D_OT_view_zoomin", WM_OP_EXEC_REGION_WIN, NULL);
+                       break;
                case 2: /* View all */
+                       WM_operator_name_call(C, "View2D_OT_view_zoomout", WM_OP_EXEC_REGION_WIN, NULL);
                        break;
                case 3: /* View all */
-                       WM_operator_name_call(C, "NODE_OT_fit_all", WM_OP_INVOKE_REGION_WIN, NULL);
+                       WM_operator_name_call(C, "NODE_OT_fit_all", WM_OP_EXEC_REGION_WIN, NULL);
                        break;
                case 4: /* Grease Pencil */
                        // XXX add_blockhandler(sa, NODES_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW);
index 088df34..cda25c6 100644 (file)
@@ -203,11 +203,6 @@ static int node_fit_all_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int node_fit_all_invoke(bContext *C, wmOperator *op, wmEvent *event)
-{
-       return node_fit_all_exec(C, op);
-}
-
 void NODE_OT_fit_all(wmOperatorType *ot)
 {
        /* identifiers */
@@ -215,6 +210,6 @@ void NODE_OT_fit_all(wmOperatorType *ot)
        ot->idname= "NODE_OT_fit_all";
        
        /* api callbacks */
-       ot->invoke= node_fit_all_invoke;
+       ot->exec= node_fit_all_exec;
        ot->poll= ED_operator_node_active;
 }
\ No newline at end of file