diff options
Diffstat (limited to 'source/blender/editors/animation/anim_markers.c')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 8cf0e203a41..b24f48a10f9 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1249,7 +1249,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; @@ -1262,13 +1262,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) { @@ -1284,7 +1282,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op) static int ed_marker_select_border_invoke_wrapper(bContext *C, wmOperator *op, const wmEvent *event) { - return ed_markers_opwrap_invoke_custom(C, op, event, WM_border_select_invoke); + return ed_markers_opwrap_invoke_custom(C, op, event, WM_gesture_border_invoke); } static void MARKER_OT_select_border(wmOperatorType *ot) @@ -1297,8 +1295,8 @@ static void MARKER_OT_select_border(wmOperatorType *ot) /* api callbacks */ ot->exec = ed_marker_border_select_exec; ot->invoke = ed_marker_select_border_invoke_wrapper; - ot->modal = WM_border_select_modal; - ot->cancel = WM_border_select_cancel; + ot->modal = WM_gesture_border_modal; + ot->cancel = WM_gesture_border_cancel; ot->poll = ed_markers_poll_markers_exist; @@ -1306,7 +1304,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 ***************** */ |