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:
authorJulian Eisel <eiseljulian@gmail.com>2019-10-04 16:11:19 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-10-04 17:46:32 +0300
commitbe2cd4bb5325fa7950a412fdd14448d49b342b57 (patch)
tree17db2242628db893831dd4594601579edcd011b5 /source/blender/windowmanager/intern/wm_operator_props.c
parent0bcada85b362fcc1874a1bf13ece157870c0fea7 (diff)
WM: Utilities for select operators to work with click-dragging items
Based on work by Bastien and Brecht in the Node Editor, this adds more generalized support for selecting items so that click+drag actions on items (nodes, makers, dopesheet keys, etc.) works as wanted. Note that this only adds the barebones to support this in other editors, it's not used yet (will be done in followup commits). The behavior is supposed to work as follows: * Clicking an unselected item immediately selects it, and deselects other items (doesn't wait for release events). * Click+drag on an unselected item immediately selects it, deselects others and drags it in one go (don't require selecting it first!). * Click+drag on a selected item won't change the selection state (and won't send an undo push) and start dragging all selected items as soon as the drag event is recognized. * Clicking on a selected item will still deselect others, but that will only happen on mouse release, when we know the intention is not to drag the item. Included in: https://developer.blender.org/D5979 Reviewed by: Brecht van Lommel, William Reynish
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operator_props.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operator_props.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c
index a8feb22cbf8..395de89c0da 100644
--- a/source/blender/windowmanager/intern/wm_operator_props.c
+++ b/source/blender/windowmanager/intern/wm_operator_props.c
@@ -396,6 +396,16 @@ void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
+void WM_operator_properties_generic_select(wmOperatorType *ot)
+{
+ PropertyRNA *prop = RNA_def_boolean(
+ ot->srna, "wait_to_deselect_others", true, "Wait to Deselect Others", "");
+ RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
+
+ RNA_def_int(ot->srna, "mouse_x", 0, INT_MIN, INT_MAX, "Mouse X", "", INT_MIN, INT_MAX);
+ RNA_def_int(ot->srna, "mouse_y", 0, INT_MIN, INT_MAX, "Mouse Y", "", INT_MIN, INT_MAX);
+}
+
void WM_operator_properties_gesture_box_zoom(wmOperatorType *ot)
{
WM_operator_properties_border(ot);