Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align cursor implementation to W3C cursors #2162

Merged
merged 18 commits into from
Aug 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support most cursors on paper
  • Loading branch information
Saadnajmi committed Aug 15, 2024
commit 5461d8db2f8fcf52ffa6266b52515490a8864e53
Original file line number Diff line number Diff line change
@@ -44,18 +44,18 @@ export type CursorValue =
| 'grabbing'
| 'help'
| 'move'
| 'ne-rsize'
| 'ne-resize'
| 'nesw-resize'
| 'n-resize'
| 'ns-resize'
| 'ns-resize'
| 'nw-resize'
| 'nswe-resize'
| 'no-drop'
| 'none'
| 'not-allowed'
| 'pointer'
| 'progress'
| 'row-esize'
| 'row-resize'
| 's-resize'
| 'se-resize'
| 'sw-resize'
Original file line number Diff line number Diff line change
@@ -613,48 +613,49 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
#if TARGET_OS_OSX // [macOS
static NSCursor *NSCursorFromCursor(Cursor cursor)
{
switch (cursor) {
case Cursor::Auto:
return [NSCursor arrowCursor];
case Cursor::Alias:
return [NSCursor dragLinkCursor];
case Cursor::ColumnResize:
return [NSCursor resizeLeftRightCursor];
case Cursor::ContextualMenu:
return [NSCursor contextualMenuCursor];
case Cursor::Copy:
return [NSCursor dragCopyCursor];
case Cursor::Crosshair:
return [NSCursor crosshairCursor];
case Cursor::Default:
return [NSCursor arrowCursor];
case Cursor::DisappearingItem:
return [NSCursor disappearingItemCursor];
case Cursor::EastResize:
return [NSCursor resizeRightCursor];
case Cursor::Grab:
return [NSCursor openHandCursor];
case Cursor::Grabbing:
return [NSCursor closedHandCursor];
case Cursor::NorthResize:
return [NSCursor resizeUpCursor];
case Cursor::NoDrop:
return [NSCursor operationNotAllowedCursor];
case Cursor::NotAllowed:
return [NSCursor operationNotAllowedCursor];
case Cursor::Pointer:
return [NSCursor pointingHandCursor];
case Cursor::RowResize:
return [NSCursor resizeUpDownCursor];
case Cursor::SouthResize:
return [NSCursor resizeDownCursor];
case Cursor::Text:
return [NSCursor IBeamCursor];
case Cursor::VerticalText:
return [NSCursor IBeamCursorForVerticalLayout];
case Cursor::WestResize:
return [NSCursor resizeLeftCursor];
}
return [NSCursor arrowCursor];
// switch (cursor) {
// case Cursor::Auto:
// return [NSCursor arrowCursor];
// case Cursor::Alias:
// return [NSCursor dragLinkCursor];
// case Cursor::ColumnResize:
// return [NSCursor resizeLeftRightCursor];
// case Cursor::ContextualMenu:
// return [NSCursor contextualMenuCursor];
// case Cursor::Copy:
// return [NSCursor dragCopyCursor];
// case Cursor::Crosshair:
// return [NSCursor crosshairCursor];
// case Cursor::Default:
// return [NSCursor arrowCursor];
// case Cursor::DisappearingItem:
// return [NSCursor disappearingItemCursor];
// case Cursor::EastResize:
// return [NSCursor resizeRightCursor];
// case Cursor::Grab:
// return [NSCursor openHandCursor];
// case Cursor::Grabbing:
// return [NSCursor closedHandCursor];
// case Cursor::NorthResize:
// return [NSCursor resizeUpCursor];
// case Cursor::NoDrop:
// return [NSCursor operationNotAllowedCursor];
// case Cursor::NotAllowed:
// return [NSCursor operationNotAllowedCursor];
// case Cursor::Pointer:
// return [NSCursor pointingHandCursor];
// case Cursor::RowResize:
// return [NSCursor resizeUpDownCursor];
// case Cursor::SouthResize:
// return [NSCursor resizeDownCursor];
// case Cursor::Text:
// return [NSCursor IBeamCursor];
// case Cursor::VerticalText:
// return [NSCursor IBeamCursorForVerticalLayout];
// case Cursor::WestResize:
// return [NSCursor resizeLeftCursor];
// }
}
#endif // macOS]

Loading
Loading