From 8d8d113b7379b96d8cd9440f4e1f87524a418fef Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Mar 2019 22:26:45 +1100 Subject: Tool System: use set/add/subtract for all circle select operators This applies changes from the 3D view circle select to other operators. --- source/blender/windowmanager/WM_api.h | 3 +-- source/blender/windowmanager/intern/wm_gesture.c | 7 +++++++ source/blender/windowmanager/intern/wm_operator_props.c | 17 +---------------- 3 files changed, 9 insertions(+), 18 deletions(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index f4b4d7cc50e..5b5904c6d73 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -375,9 +375,7 @@ void WM_operator_properties_gesture_lasso_ex(struct wmOperatorType *ot, b void WM_operator_properties_gesture_lasso(struct wmOperatorType *ot); void WM_operator_properties_gesture_lasso_select(struct wmOperatorType *ot); void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor); -void WM_operator_properties_gesture_circle_ex(struct wmOperatorType *ot, bool deselect); void WM_operator_properties_gesture_circle(struct wmOperatorType *ot); -void WM_operator_properties_gesture_circle_select(struct wmOperatorType *ot); void WM_operator_properties_mouse_select(struct wmOperatorType *ot); void WM_operator_properties_select_all(struct wmOperatorType *ot); void WM_operator_properties_select_action(struct wmOperatorType *ot, int default_action); @@ -483,6 +481,7 @@ void WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op); struct wmGesture *WM_gesture_new(struct bContext *C, const struct wmEvent *event, int type); void WM_gesture_end(struct bContext *C, struct wmGesture *gesture); void WM_gestures_remove(struct bContext *C); +bool WM_gesture_is_modal_first(const struct wmGesture *gesture); /* fileselecting support */ void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op); diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 09fc143f71d..c9853776902 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -116,6 +116,13 @@ void WM_gestures_remove(bContext *C) WM_gesture_end(C, win->gesture.first); } +bool WM_gesture_is_modal_first(const wmGesture *gesture) +{ + if (gesture == NULL) { + return true; + } + return (gesture->is_active_prev == false); +} /* tweak and line gestures */ int wm_gesture_evaluate(wmGesture *gesture) diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 330c66c3a6a..5700e4fc0bc 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -353,7 +353,7 @@ void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor) /** * Use with #WM_gesture_circle_invoke */ -void WM_operator_properties_gesture_circle_ex(wmOperatorType *ot, bool deselect) +void WM_operator_properties_gesture_circle(wmOperatorType *ot) { PropertyRNA *prop; const int radius_default = 25; @@ -366,21 +366,6 @@ void WM_operator_properties_gesture_circle_ex(wmOperatorType *ot, bool deselect) prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", ""); RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); - - if (deselect) { - prop = RNA_def_boolean(ot->srna, "deselect", false, "Deselect", "Deselect rather than select items"); - RNA_def_property_flag(prop, PROP_SKIP_SAVE); - } -} - -void WM_operator_properties_gesture_circle(wmOperatorType *ot) -{ - WM_operator_properties_gesture_circle_ex(ot, false); -} - -void WM_operator_properties_gesture_circle_select(wmOperatorType *ot) -{ - WM_operator_properties_gesture_circle_ex(ot, true); } void WM_operator_properties_mouse_select(wmOperatorType *ot) -- cgit v1.2.3