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:
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index e82f6cc9d76..297575e8dff 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2087,6 +2087,7 @@ typedef struct {
bool use_secondary_tex;
void *cursor;
NumInput num_input;
+ int init_event;
} RadialControl;
static void radial_control_update_header(wmOperator *op, bContext *C)
@@ -2705,6 +2706,8 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve
radial_control_set_initial_mouse(rc, event);
radial_control_set_tex(rc);
+ rc->init_event = WM_userdef_event_type_from_keymap_type(event->type);
+
/* temporarily disable other paint cursors */
wm = CTX_wm_manager(C);
rc->orig_paintcursors = wm->paintcursors;
@@ -2962,6 +2965,11 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
return OPERATOR_RUNNING_MODAL;
}
+ if (!handled && (event->val == KM_RELEASE) && (rc->init_event == event->type) &&
+ RNA_boolean_get(op->ptr, "release_confirm")) {
+ ret = OPERATOR_FINISHED;
+ }
+
ED_region_tag_redraw(CTX_wm_region(C));
radial_control_update_header(op, C);
@@ -3070,6 +3078,10 @@ static void WM_OT_radial_control(wmOperatorType *ot)
prop = RNA_def_boolean(
ot->srna, "secondary_tex", false, "Secondary Texture", "Tweak brush secondary/mask texture");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
+ prop = RNA_def_boolean(
+ ot->srna, "release_confirm", false, "Confirm On Release", "Finish operation on key release");
+ RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
/** \} */