[Bf-blender-cvs] [3b1a16833b5] master: UI: Area Split and Join Mouse Cursor Feedback
Harley Acheson
noreply at git.blender.org
Mon Sep 6 18:41:09 CEST 2021
Commit: 3b1a16833b5834d768eacbcfdff4ee000a8d1af5
Author: Harley Acheson
Date: Mon Sep 6 09:40:06 2021 -0700
Branches: master
https://developer.blender.org/rB3b1a16833b5834d768eacbcfdff4ee000a8d1af5
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
===================================================================
M source/blender/editors/screen/screen_ops.c
===================================================================
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;
}
}
More information about the Bf-blender-cvs
mailing list