UI: Custom Windows Cursors for VSE Handles
VSE has three mouse cursors defined, WM_CURSOR_LEFT_HANDLE, WM_CURSOR_RIGHT_HANDLE, and WM_CURSOR_BOTH_HANDLES that are currently always using our default cursor format. This format works on all platforms but does not support multiple sizes or antialiasing. This PR makes these use custom cursors (created by Pablo Vazquez) on the Windows platform. Pull Request: https://projects.blender.org/blender/blender/pulls/125252
This commit is contained in:
committed by
Harley Acheson
parent
0d70481d15
commit
459572b15f
@@ -360,6 +360,9 @@ typedef enum {
|
||||
GHOST_kStandardCursorBottomRightCorner,
|
||||
GHOST_kStandardCursorBottomLeftCorner,
|
||||
GHOST_kStandardCursorCopy,
|
||||
GHOST_kStandardCursorLeftHandle,
|
||||
GHOST_kStandardCursorRightHandle,
|
||||
GHOST_kStandardCursorBothHandles,
|
||||
GHOST_kStandardCursorCustom,
|
||||
|
||||
#define GHOST_kStandardCursorNumCursors (int(GHOST_kStandardCursorCustom) + 1)
|
||||
|
||||
@@ -823,6 +823,16 @@ HCURSOR GHOST_WindowWin32::getStandardCursor(GHOST_TStandardCursor shape) const
|
||||
case GHOST_kStandardCursorStop:
|
||||
cursor = ::LoadImage(module, "forbidden_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Slashed circle */
|
||||
case GHOST_kStandardCursorLeftHandle:
|
||||
cursor = ::LoadImage(module, "handle_left_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break;
|
||||
case GHOST_kStandardCursorRightHandle:
|
||||
cursor = ::LoadImage(module, "handle_right_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break;
|
||||
case GHOST_kStandardCursorBothHandles:
|
||||
cursor = ::LoadImage(module, "handle_both_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break;
|
||||
|
||||
case GHOST_kStandardCursorDefault:
|
||||
cursor = nullptr;
|
||||
break;
|
||||
|
||||
BIN
release/windows/icons/cursors/handle_both.cur
Normal file
BIN
release/windows/icons/cursors/handle_both.cur
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
release/windows/icons/cursors/handle_left.cur
Normal file
BIN
release/windows/icons/cursors/handle_left.cur
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
BIN
release/windows/icons/cursors/handle_right.cur
Normal file
BIN
release/windows/icons/cursors/handle_right.cur
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -36,6 +36,9 @@ splitv_cursor CURSOR "cursors/splitv.cur"
|
||||
zoomin_cursor CURSOR "cursors/zoomin.cur"
|
||||
zoomout_cursor CURSOR "cursors/zoomout.cur"
|
||||
forbidden_cursor CURSOR "cursors/forbidden.cur"
|
||||
handle_left_cursor CURSOR "cursors/handle_left.cur"
|
||||
handle_right_cursor CURSOR "cursors/handle_right.cur"
|
||||
handle_both_cursor CURSOR "cursors/handle_both.cur"
|
||||
|
||||
IDR_VERSION1 VERSIONINFO
|
||||
FILEVERSION BLEN_VER_RC_1, BLEN_VER_RC_2, BLEN_VER_RC_3, BLEN_VER_RC_4
|
||||
|
||||
@@ -97,6 +97,12 @@ static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
|
||||
return GHOST_kStandardCursorRightArrow;
|
||||
case WM_CURSOR_W_ARROW:
|
||||
return GHOST_kStandardCursorLeftArrow;
|
||||
case WM_CURSOR_LEFT_HANDLE:
|
||||
return GHOST_kStandardCursorLeftHandle;
|
||||
case WM_CURSOR_RIGHT_HANDLE:
|
||||
return GHOST_kStandardCursorRightHandle;
|
||||
case WM_CURSOR_BOTH_HANDLES:
|
||||
return GHOST_kStandardCursorBothHandles;
|
||||
default:
|
||||
return GHOST_kStandardCursorCustom;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user