UI: Changes to Docking Mouse Cursors

This makes one change and another correction to the mouse cursors used
during Docking. The change is to use WM_CURSOR_EDIT for Mac while just
hovering over the corner action zones. This means that Mac users will
transition from this to WM_CURSOR_HAND_CLOSED, instead using two hand
cursors.  The correction is to use the "split" cursors while splitting
areas. That it doesn't do that now is a mistake made during #127810.

Pull Request: https://projects.blender.org/blender/blender/pulls/128396
This commit is contained in:
Harley Acheson
2024-10-01 21:04:20 +02:00
committed by Harley Acheson
parent ab3e470b35
commit bfe693c8c2
2 changed files with 14 additions and 6 deletions

View File

@@ -974,11 +974,7 @@ static void screen_cursor_set(wmWindow *win, const int xy[2])
if (area) {
if (az->type == AZONE_AREA) {
#if defined(__APPLE__)
WM_cursor_set(win, WM_CURSOR_HAND);
#else
WM_cursor_set(win, WM_CURSOR_EDIT);
#endif
}
else if (az->type == AZONE_REGION) {
if (ELEM(az->edge, AE_LEFT_TO_TOPRIGHT, AE_RIGHT_TO_TOPLEFT)) {

View File

@@ -3863,11 +3863,23 @@ static int area_join_cursor(sAreaJoinData *jd, const wmEvent *event)
}
}
if (jd->sa1 && jd->sa1 == jd->sa2) {
if (jd->split_fac >= 0.0001f) {
/* Mouse inside source area, so allow splitting. */
return (jd->split_dir == SCREEN_AXIS_V) ? WM_CURSOR_V_SPLIT : WM_CURSOR_H_SPLIT;
}
return WM_CURSOR_EDIT;
}
if (jd->dir != SCREEN_DIR_NONE || jd->dock_target != AreaDockTarget::None) {
#if defined(__APPLE__)
return WM_CURSOR_HAND_CLOSED;
return WM_CURSOR_HAND_CLOSED;
#else
return WM_CURSOR_MOVE;
return WM_CURSOR_MOVE;
#endif
}
return WM_CURSOR_PICK_AREA;
}
static float area_docking_snap(const float pos, const wmEvent *event)