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>2017-10-16 13:58:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-10-16 14:21:46 +0300
commit870b4b673511094cf0beaeaf07305407ccdda47a (patch)
treefb91f7c424f1971c35d537e520c519117e38f9d9 /source/blender/editors/animation/anim_markers.c
parent6d8f63a8343a6c0b44318f0a856dcd0fd0206131 (diff)
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.
Diffstat (limited to 'source/blender/editors/animation/anim_markers.c')
-rw-r--r--source/blender/editors/animation/anim_markers.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 926a41dd7ab..30aaee8cbd9 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -1230,7 +1230,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
View2D *v2d = UI_view2d_fromcontext(C);
ListBase *markers = ED_context_get_markers(C);
TimeMarker *marker;
- int gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
+ bool select = !RNA_boolean_get(op->ptr, "deselect");
bool extend = RNA_boolean_get(op->ptr, "extend");
rctf rect;
@@ -1243,13 +1243,11 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
/* XXX marker context */
for (marker = markers->first; marker; marker = marker->next) {
if (BLI_rctf_isect_x(&rect, marker->frame)) {
- switch (gesture_mode) {
- case GESTURE_MODAL_SELECT:
- marker->flag |= SELECT;
- break;
- case GESTURE_MODAL_DESELECT:
- marker->flag &= ~SELECT;
- break;
+ if (select) {
+ marker->flag |= SELECT;
+ }
+ else {
+ marker->flag &= ~SELECT;
}
}
else if (!extend) {
@@ -1287,7 +1285,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* rna */
- WM_operator_properties_gesture_border(ot, true);
+ WM_operator_properties_gesture_border_select(ot);
}
/* *********************** (de)select all ***************** */