WM: refactor gestures for use as tools
[blender.git] / source / blender / editors / animation / anim_markers.c
index 926a41dd7ab4f2441501740b8bca761cbc43111f..30aaee8cbd9157ba25ee3c2b413dcfbf9ef9b29e 100644 (file)
@@ -1230,7 +1230,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
        View2D *v2d = UI_view2d_fromcontext(C);
        ListBase *markers = ED_context_get_markers(C);
        TimeMarker *marker;
-       int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
+       bool select = !RNA_boolean_get(op->ptr, "deselect");
        bool extend = RNA_boolean_get(op->ptr, "extend");
        rctf rect;
        
@@ -1243,13 +1243,11 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
        /* XXX marker context */
        for (marker = markers->first; marker; marker = marker->next) {
                if (BLI_rctf_isect_x(&rect, marker->frame)) {
-                       switch (gesture_mode) {
-                               case GESTURE_MODAL_SELECT:
-                                       marker->flag |= SELECT;
-                                       break;
-                               case GESTURE_MODAL_DESELECT:
-                                       marker->flag &= ~SELECT;
-                                       break;
+                       if (select) {
+                               marker->flag |= SELECT;
+                       }
+                       else {
+                               marker->flag &= ~SELECT;
                        }
                }
                else if (!extend) {
@@ -1287,7 +1285,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot)
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* rna */
-       WM_operator_properties_gesture_border(ot, true);
+       WM_operator_properties_gesture_border_select(ot);
 }
 
 /* *********************** (de)select all ***************** */