Cleanup: remove outdated references to tweak

This commit is contained in:
Campbell Barton 2022-03-04 13:31:16 +11:00
parent 0a4fdcbb5f
commit 0212c423bf
16 changed files with 25 additions and 25 deletions

View File

@ -388,6 +388,7 @@ static bool keymap_item_has_invalid_wm_context_data_path(wmKeyMapItem *kmi,
return false;
}
/** Tweak event types have been removed, replace with click-drag. */
static bool keymap_item_update_tweak_event(wmKeyMapItem *kmi, void *UNUSED(user_data))
{
/* Tweak events for L M R mouse-buttons. */

View File

@ -1042,7 +1042,7 @@ static void MARKER_OT_move(wmOperatorType *ot)
/* rna storage */
RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
PropertyRNA *prop = RNA_def_boolean(
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
@ -1418,7 +1418,7 @@ static void MARKER_OT_select_box(wmOperatorType *ot)
WM_operator_properties_select_operation_simple(ot);
PropertyRNA *prop = RNA_def_boolean(
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

View File

@ -9373,7 +9373,7 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
/**
* Activate the underlying list-row button, so the row is highlighted.
* Early exits if \a activate_dragging is true, but the custom drag operator fails to execute.
* Gives the wanted behavior where the item is activated on a tweak event when the custom drag
* Gives the wanted behavior where the item is activated on a click-drag event when the custom drag
* operator is executed.
*/
static int ui_list_activate_hovered_row(bContext *C,

View File

@ -595,7 +595,7 @@ void ACTION_OT_select_box(wmOperatorType *ot)
WM_operator_properties_select_operation_simple(ot);
PropertyRNA *prop = RNA_def_boolean(
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

View File

@ -903,7 +903,7 @@ void GRAPH_OT_select_box(wmOperatorType *ot)
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(

View File

@ -405,7 +405,7 @@ void NLA_OT_select_box(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", "");
PropertyRNA *prop = RNA_def_boolean(
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
WM_operator_properties_gesture_box(ot);

View File

@ -1725,7 +1725,7 @@ void SEQUENCER_OT_select_box(wmOperatorType *ot)
WM_operator_properties_select_operation_simple(ot);
prop = RNA_def_boolean(
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a tweak event");
ot->srna, "tweak", 0, "Tweak", "Operator has been activated using a click-drag event");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_boolean(
ot->srna, "include_handles", 0, "Select Handles", "Select the strips and their handles");

View File

@ -362,7 +362,7 @@ typedef struct wmKeyMapItem {
short type;
/** KM_ANY, KM_PRESS, KM_NOTHING etc. */
int8_t val;
/** Use when `val == WM_CLICK_DRAG`, */
/** Use when `val == KM_CLICK_DRAG`, */
int8_t direction;
/** `oskey` also known as apple, windows-key or super. */
short shift, ctrl, alt, oskey;

View File

@ -5899,20 +5899,20 @@ static void rna_def_userdef_input(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.1f, 2.0f, 0.01f, 2);
RNA_def_property_ui_text(prop, "Orbit Sensitivity", "Scale trackball orbit sensitivity");
/* tweak tablet & mouse preset */
/* Click-drag threshold for tablet & mouse. */
prop = RNA_def_property(srna, "drag_threshold_mouse", PROP_INT, PROP_PIXEL);
RNA_def_property_range(prop, 1, 255);
RNA_def_property_ui_text(prop,
"Mouse Drag Threshold",
"Number of pixels to drag before a tweak/drag event is triggered "
"for mouse/trackpad input "
"Number of pixels to drag before a drag event is triggered "
"for mouse/track-pad input "
"(otherwise click events are detected)");
prop = RNA_def_property(srna, "drag_threshold_tablet", PROP_INT, PROP_PIXEL);
RNA_def_property_range(prop, 1, 255);
RNA_def_property_ui_text(prop,
"Tablet Drag Threshold",
"Number of pixels to drag before a tweak/drag event is triggered "
"Number of pixels to drag before a drag event is triggered "
"for tablet input "
"(otherwise click events are detected)");

View File

@ -796,14 +796,14 @@ void WM_operator_properties_select_walk_direction(struct wmOperatorType *ot);
* For default click selection (with no modifier keys held), the select operators can do the
* following:
* - On a mouse press on an unselected item, change selection and finish immediately after.
* This sends an undo push and allows transform to take over should a tweak event be caught now.
* This sends an undo push and allows transform to take over should a click-drag event be caught.
* - On a mouse press on a selected item, don't change selection state, but start modal execution
* of the operator. Idea is that we wait with deselecting other items until we know that the
* intention wasn't to tweak (mouse press+drag) all selected items.
* - If a tweak is recognized before the release event happens, cancel the operator, so that
* transform can take over and no undo-push is sent.
* - If the release event occurs rather than a tweak one, deselect all items but the one under the
* cursor, and finish the modal operator.
* - If a click-drag is recognized before the release event happens, cancel the operator,
* so that transform can take over and no undo-push is sent.
* - If the release event occurs rather than a click-drag one,
* deselect all items but the one under the cursor, and finish the modal operator.
*
* This utility, together with #WM_generic_select_invoke() and #WM_generic_select_modal() should
* help getting the wanted behavior to work. Most generic logic should be handled in these, so that

View File

@ -273,7 +273,7 @@ enum {
/**
* #wmKeyMapItem.direction
*
* Value of tweaks and line gestures. #KM_ANY (-1) works for this case too.
* Direction set for #KM_CLICK_DRAG key-map items. #KM_ANY (-1) to ignore direction.
*/
enum {
KM_DIRECTION_N = 1,

View File

@ -136,7 +136,7 @@ typedef enum eWM_GizmoFlagGroupTypeFlag {
*
* The result for the user is tweak events delay the gizmo from flashing under the users cursor,
* for selection operations. This means gizmos that use this check don't interfere
* with click drag events by popping up under the cursor and catching the tweak event.
* with click-drag events by popping up under the cursor and catching the drag-drag event.
*/
WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK = (1 << 9),

View File

@ -607,7 +607,7 @@ void GIZMOGROUP_OT_gizmo_tweak(wmOperatorType *ot)
ot->invoke = gizmo_tweak_invoke;
ot->modal = gizmo_tweak_modal;
/* TODO(campbell): This causes problems tweaking settings for operators,
/* TODO(@campbellbarton): This causes problems tweaking settings for operators,
* need to find a way to support this. */
#if 0
ot->flag = OPTYPE_UNDO;

View File

@ -3156,7 +3156,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
}
if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) {
/* Test for #WM_CLICK_DRAG events. */
/* Test for #KM_CLICK_DRAG events. */
/* NOTE(@campbellbarton): Needed so drag can be used for editors that support both click
* selection and passing through the drag action to box select. See #WM_generic_select_modal.
@ -3224,8 +3224,7 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
if (win->event_queue_check_drag) {
if ((event->prev_click_type != event->type) &&
(ISKEYMODIFIER(event->type) || (event->type == event->prev_click_keymodifier))) {
/* Support releasing modifier keys without canceling the drag event, see T89989.
* NOTE: this logic is replicated for tweak gestures. */
/* Support releasing modifier keys without canceling the drag event, see T89989. */
}
else {
win->event_queue_check_drag = false;

View File

@ -947,7 +947,7 @@ int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_FINISHED | OPERATOR_PASS_THROUGH;
}
/* Important not to return anything other than PASS_THROUGH here,
* otherwise it prevents underlying tweak detection code to work properly. */
* otherwise it prevents underlying drag detection code to work properly. */
return OPERATOR_PASS_THROUGH;
}

View File

@ -72,7 +72,7 @@ void wm_operatortypes_register(void);
void wm_gesture_draw(struct wmWindow *win);
/**
* Tweak and line gestures.
* Use for line gesture.
*/
void wm_gesture_tag_redraw(struct wmWindow *win);