diff options
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 75ee3300e63..81da54ade9e 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -168,12 +168,14 @@ static bool ui_mouse_motion_keynav_test(struct uiKeyNavLock *keynav, const wmEve #define PIE_MENU_INTERVAL 0.01 #define BUTTON_AUTO_OPEN_THRESH 0.2 #define BUTTON_MOUSE_TOWARDS_THRESH 1.0 -/* pixels to move the cursor to get out of keyboard navigation */ +/** Pixels to move the cursor to get out of keyboard navigation. */ #define BUTTON_KEYNAV_PX_LIMIT 8 -#define MENU_TOWARDS_MARGIN 20 /* margin in pixels */ -#define MENU_TOWARDS_WIGGLE_ROOM 64 /* tolerance in pixels */ -/* drag-lock distance threshold in pixels */ +/** Margin around the menu, use to check if we're moving towards this rectangle (in pixels). */ +#define MENU_TOWARDS_MARGIN 20 +/** Tolerance for closing menus (in pixels). */ +#define MENU_TOWARDS_WIGGLE_ROOM 64 +/** Drag-lock distance threshold (in pixels). */ #define BUTTON_DRAGLOCK_THRESH 3 typedef enum uiButtonActivateType { @@ -5244,8 +5246,8 @@ static bool ui_numedit_but_SLI(uiBut *but, (but->softmax - but->softmin + but->a1); } else { - const float offs = (BLI_rctf_size_y(&but->rect) / 2.0f); - cursor_x_range = (BLI_rctf_size_x(&but->rect) - offs); + const float ofs = (BLI_rctf_size_y(&but->rect) / 2.0f); + cursor_x_range = (BLI_rctf_size_x(&but->rect) - ofs); } f = (mx_fl - data->dragstartx) / cursor_x_range + data->dragfstart; @@ -7781,7 +7783,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * if ((data->str && ELEM(data->state, BUTTON_STATE_TEXT_EDITING, BUTTON_STATE_NUM_EDITING)) || ((abs(data->multi_data.drag_lock_x - event->x) > margin_x) && - /* just to be sure, check we're dragging more hoz then virt */ + /* Just to be sure, check we're dragging more horizontally then vertically. */ abs(event->prevx - event->x) > abs(event->prevy - event->y))) { if (data->multi_data.has_mbuts) { ui_multibut_states_create(but, data); @@ -9330,8 +9332,8 @@ static void ui_mouse_motion_keynav_init(struct uiKeyNavLock *keynav, const wmEve copy_v2_v2_int(keynav->event_xy, &event->x); } /** - * Return true if keyinput isn't blocking mouse-motion, - * or if the mouse-motion is enough to disable keyinput. + * Return true if key-input isn't blocking mouse-motion, + * or if the mouse-motion is enough to disable key-input. */ static bool ui_mouse_motion_keynav_test(struct uiKeyNavLock *keynav, const wmEvent *event) { @@ -10444,7 +10446,7 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle } } - if (event->type == block->pie_data.event && !is_click_style) { + if (event->type == block->pie_data.event_type && !is_click_style) { if (event->val != KM_RELEASE) { ui_handle_menu_button(C, event, menu); @@ -10618,7 +10620,7 @@ static int ui_handle_menus_recursive(bContext *C, /* root pie menus accept the key that spawned * them as double click to improve responsiveness */ const bool do_recursion = (!(block->flag & UI_BLOCK_RADIAL) || - event->type != block->pie_data.event); + event->type != block->pie_data.event_type); if (do_recursion) { if (is_parent_inside == false) { @@ -10911,7 +10913,7 @@ static int ui_popup_handler(bContext *C, const wmEvent *event, void *userdata) /* set last pie event to allow chained pie spawning */ if (block->flag & UI_BLOCK_RADIAL) { - win->last_pie_event = block->pie_data.event; + win->pie_event_type_last = block->pie_data.event_type; reset_pie = true; } @@ -10954,7 +10956,7 @@ static int ui_popup_handler(bContext *C, const wmEvent *event, void *userdata) wmWindow *win = CTX_wm_window(C); if (win) { - win->last_pie_event = EVENT_NONE; + win->pie_event_type_last = EVENT_NONE; } } |