Use cursor-icon crate for CursorIcon

This crate is aimed to simplify handling of cursor icon across
various crates and be used in the public API.
This commit is contained in:
Kirill Chibisov 2023-05-09 20:19:35 +03:00 committed by GitHub
parent 596c0edf0f
commit bd9cc2a9da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 54 additions and 250 deletions

View file

@ -197,8 +197,7 @@ impl NSCursor {
pub fn from_icon(icon: CursorIcon) -> Id<Self, Shared> {
match icon {
CursorIcon::Default => Default::default(),
CursorIcon::Arrow => Self::arrowCursor(),
CursorIcon::Hand => Self::pointingHandCursor(),
CursorIcon::Pointer => Self::pointingHandCursor(),
CursorIcon::Grab => Self::openHandCursor(),
CursorIcon::Grabbing => Self::closedHandCursor(),
CursorIcon::Text => Self::IBeamCursor(),
@ -228,6 +227,7 @@ impl NSCursor {
CursorIcon::Wait | CursorIcon::Progress => Self::busyButClickableCursor(),
CursorIcon::Move | CursorIcon::AllScroll => Self::moveCursor(),
CursorIcon::Cell => Self::cellCursor(),
_ => Default::default(),
}
}
}