Merge pull request #37 from glepnir/add_cursor

feat: add current cursor and currentsystem cursor
This commit is contained in:
Ryan McGrath 2022-07-30 16:05:10 -07:00 committed by GitHub
commit 6abb235c2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,12 @@ pub enum CursorType {
/// A standard arrow.
Arrow,
/// Current Cusrosr
Current,
/// Current System cursor
CurrentSystem,
/// A crosshair.
Crosshair,
@ -96,6 +102,8 @@ impl Cursor {
unsafe {
let cursor: id = match cursor_type {
CursorType::Arrow => msg_send![class!(NSCursor), arrowCursor],
CursorType::Current => msg_send![class!(NSCursor), currentCursor],
CursorType::CurrentSystem => msg_send![class!(NSCursor), currentSystemCursor],
CursorType::Crosshair => msg_send![class!(NSCursor), crosshairCursor],
CursorType::ClosedHand => msg_send![class!(NSCursor), closedHandCursor],
CursorType::OpenHand => msg_send![class!(NSCursor), openHandCursor],