Add support for horizontalDoubleArrow and verticalDoubleArrow cursors (flutter/engine#18916)

This commit is contained in:
Todd Volkert
2020-06-10 07:17:11 -07:00
committed by GitHub
parent dc44418b3e
commit 816d136b0d
3 changed files with 10 additions and 0 deletions

View File

@@ -30,6 +30,8 @@ class MouseCursor {
'forbidden': 'not-allowed',
'grab': 'grab',
'grabbing': 'grabbing',
'horizontalDoubleArrow': 'ew-resize',
'verticalDoubleArrow': 'ns-resize',
};
static String _mapKindToCssValue(String kind) {
return _kindToCssValueMap[kind] ?? 'default';

View File

@@ -54,6 +54,10 @@ public class MouseCursorPlugin {
// "forbidden": default
put("grab", Integer.valueOf(PointerIcon.TYPE_GRAB));
put("grabbing", Integer.valueOf(PointerIcon.TYPE_GRABBING));
put(
"horizontalDoubleArrow",
Integer.valueOf(PointerIcon.TYPE_HORIZONTAL_DOUBLE_ARROW));
put("verticalDoubleArrow", Integer.valueOf(PointerIcon.TYPE_VERTICAL_DOUBLE_ARROW));
}
};
}

View File

@@ -34,6 +34,10 @@ static NSCursor* GetCursorForKind(NSString* kind) {
return [NSCursor openHandCursor];
else if ([kind isEqualToString:@"grabbing"])
return [NSCursor closedHandCursor];
else if ([kind isEqualToString:@"horizontalDoubleArrow"])
return [NSCursor resizeLeftRightCursor];
else if ([kind isEqualToString:@"verticalDoubleArrow"])
return [NSCursor resizeUpDownCursor];
else
return [NSCursor arrowCursor];
}