diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-09-06 19:40:06 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-09-06 19:40:59 +0300 |
commit | 3b1a16833b5834d768eacbcfdff4ee000a8d1af5 (patch) | |
tree | e2538d37fa53fc486c5cf06988c7a9784895bfb2 /source/blender/editors/screen/screen_ops.c | |
parent | 5a9a16334c573c4566dc9b2a314cf0d0ccdcb54f (diff) |
UI: Area Split and Join Mouse Cursor Feedback
This patch just changes the mouse cursor to a "stop sign" when dragging
to an unsupported location during Join or Split operations.
See D11396 for details and examples.
Differential Revision: https://developer.blender.org/D11396
Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 75f1baf30bb..5d6f21f4854 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1134,14 +1134,22 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) if ((ED_area_actionzone_find_xy(sad->sa1, &event->x) != sad->az) && (screen_geom_area_map_find_active_scredge( AREAMAP_FROM_SCREEN(screen), &screen_rect, event->x, event->y) == NULL)) { - /* Are we still in same area? */ - if (BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y) == sad->sa1) { + + /* What area are we now in? */ + ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->x, event->y); + + if (area == sad->sa1) { /* Same area, so possible split. */ WM_cursor_set(win, SCREEN_DIR_IS_VERTICAL(sad->gesture_dir) ? WM_CURSOR_H_SPLIT : WM_CURSOR_V_SPLIT); is_gesture = (delta_max > split_threshold); } + else if (!area || area->global) { + /* No area or Top bar or Status bar. */ + WM_cursor_set(win, WM_CURSOR_STOP); + is_gesture = false; + } else { /* Different area, so possible join. */ if (sad->gesture_dir == SCREEN_DIR_N) { @@ -1161,7 +1169,7 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) } } else { - WM_cursor_set(CTX_wm_window(C), WM_CURSOR_CROSS); + WM_cursor_set(win, WM_CURSOR_CROSS); is_gesture = false; } } |