From 56a533c0711a486375408afaa7ac51da1613ccee Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 31 May 2019 19:53:24 +1000 Subject: WM: option to ignore cursor image/clip/view2d zoom In preparation for view navigation gizmos. --- source/blender/windowmanager/WM_api.h | 1 + source/blender/windowmanager/intern/wm_operator_props.c | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 7eefbb4d648..558eb97c54b 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -445,6 +445,7 @@ void WM_operator_properties_filesel(struct wmOperatorType *ot, short flag, short display, short sort); +void WM_operator_properties_use_cursor_init(struct wmOperatorType *ot); void WM_operator_properties_border(struct wmOperatorType *ot); void WM_operator_properties_border_to_rcti(struct wmOperator *op, struct rcti *rect); void WM_operator_properties_border_to_rctf(struct wmOperator *op, rctf *rect); diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index 3ad7247d993..c471cb6f922 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -334,6 +334,17 @@ void WM_operator_properties_gesture_box_ex(wmOperatorType *ot, bool deselect, bo } } +/** + * Disable using cursor position, + * use when view operators are initialized from buttons. + */ +void WM_operator_properties_use_cursor_init(wmOperatorType *ot) +{ + PropertyRNA *prop = RNA_def_boolean( + ot->srna, "use_cursor_init", true, "Cursor Init", "Use initial cursor position"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE | PROP_HIDDEN); +} + void WM_operator_properties_gesture_box_select(wmOperatorType *ot) { WM_operator_properties_gesture_box_ex(ot, true, true); -- cgit v1.2.3