From 8550c2b92251815a39f95a9128f1fbc51f204a07 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Oct 2017 17:01:28 +1100 Subject: Cleanup: modal operator border callback names Use same convention as all others. Remove 'select' since these are used for zoom as well. --- source/blender/editors/space_outliner/outliner_select.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner_select.c') diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 18cc2a015e6..4ed524a4fff 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1119,10 +1119,10 @@ void OUTLINER_OT_select_border(wmOperatorType *ot) ot->description = "Use box selection to select tree elements"; /* api callbacks */ - ot->invoke = WM_border_select_invoke; + ot->invoke = WM_gesture_border_invoke; ot->exec = outliner_border_select_exec; - 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_operator_outliner_active; -- cgit v1.2.3 From 870b4b673511094cf0beaeaf07305407ccdda47a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Oct 2017 21:58:51 +1100 Subject: WM: refactor gestures for use as tools Border and circle select wait for input by default. This commit uses bool properties on the operators instead of magic number (called "gesture_mode"). Keymaps that define 'deselect' for border/circle select begin immediately, exiting when on button release. --- source/blender/editors/space_outliner/outliner_select.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_outliner/outliner_select.c') diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 4ed524a4fff..5cc83d3ee94 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -1068,12 +1068,12 @@ void OUTLINER_OT_item_activate(wmOperatorType *ot) /* ****************************************************** */ /* **************** Border Select Tool ****************** */ -static void outliner_item_border_select(Scene *scene, rctf *rectf, TreeElement *te, int gesture_mode) +static void outliner_item_border_select(Scene *scene, rctf *rectf, TreeElement *te, bool select) { TreeStoreElem *tselem = TREESTORE(te); if (te->ys <= rectf->ymax && te->ys + UI_UNIT_Y >= rectf->ymin) { - if (gesture_mode == GESTURE_MODAL_SELECT) { + if (select) { tselem->flag |= TSE_SELECTED; } else { @@ -1084,7 +1084,7 @@ static void outliner_item_border_select(Scene *scene, rctf *rectf, TreeElement * /* Look at its children. */ if ((tselem->flag & TSE_CLOSED) == 0) { for (te = te->subtree.first; te; te = te->next) { - outliner_item_border_select(scene, rectf, te, gesture_mode); + outliner_item_border_select(scene, rectf, te, select); } } } @@ -1096,13 +1096,13 @@ static int outliner_border_select_exec(bContext *C, wmOperator *op) ARegion *ar = CTX_wm_region(C); TreeElement *te; rctf rectf; - int gesture_mode = RNA_int_get(op->ptr, "gesture_mode"); + bool select = !RNA_boolean_get(op->ptr, "deselect"); WM_operator_properties_border_to_rctf(op, &rectf); UI_view2d_region_to_view_rctf(&ar->v2d, &rectf, &rectf); for (te = soops->tree.first; te; te = te->next) { - outliner_item_border_select(scene, &rectf, te, gesture_mode); + outliner_item_border_select(scene, &rectf, te, select); } WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -1130,7 +1130,7 @@ void OUTLINER_OT_select_border(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; /* rna */ - WM_operator_properties_gesture_border(ot, false); + WM_operator_properties_gesture_border_ex(ot, true, false); } /* ****************************************************** */ -- cgit v1.2.3