Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-03-07 12:33:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-07 12:34:10 +0300
commit219e2f976d077c16c28d72a2f6763c01230c5bf8 (patch)
treeba40e7f79947dd11cae4a08ed813f920c00fbfd7 /source/blender/editors/space_sequencer
parente52e0c83d717b46afcce36b23e3f6b32f5cb535b (diff)
Tool System: use set/add/subtract for all box select operators
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 2d035c70934..b87e0b185a4 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -881,29 +881,27 @@ static int sequencer_box_select_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Editing *ed = BKE_sequencer_editing_get(scene, false);
- View2D *v2d = UI_view2d_fromcontext(C);
+ if (ed == NULL) {
+ return OPERATOR_CANCELLED;
+ }
- Sequence *seq;
- rctf rectf, rq;
- const bool select = !RNA_boolean_get(op->ptr, "deselect");
- const bool extend = RNA_boolean_get(op->ptr, "extend");
+ View2D *v2d = UI_view2d_fromcontext(C);
- if (ed == NULL)
- return OPERATOR_CANCELLED;
+ const eSelectOp sel_op = RNA_enum_get(op->ptr, "mode");
+ const bool select = (sel_op != SEL_OP_SUB);
+ if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
+ ED_sequencer_deselect_all(scene);
+ }
+ rctf rectf;
WM_operator_properties_border_to_rctf(op, &rectf);
UI_view2d_region_to_view_rctf(v2d, &rectf, &rectf);
- for (seq = ed->seqbasep->first; seq; seq = seq->next) {
+ for (Sequence *seq = ed->seqbasep->first; seq; seq = seq->next) {
+ rctf rq;
seq_rectf(seq, &rq);
-
if (BLI_rctf_isect(&rq, &rectf, NULL)) {
- if (select) seq->flag |= SELECT;
- else seq->flag &= ~SEQ_ALLSEL;
- recurs_sel_seq(seq);
- }
- else if (!extend) {
- seq->flag &= ~SEQ_ALLSEL;
+ SET_FLAG_FROM_TEST(seq->flag, select, SELECT);
recurs_sel_seq(seq);
}
}
@@ -933,8 +931,9 @@ void SEQUENCER_OT_select_box(wmOperatorType *ot)
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
- /* rna */
- WM_operator_properties_gesture_box_select(ot);
+ /* properties */
+ WM_operator_properties_gesture_box(ot);
+ WM_operator_properties_select_operation_simple(ot);
}
/* ****** Selected Grouped ****** */