-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2134538
commit 5744a2b
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use winapi::{ | ||
shared::ntdef::PCWSTR, | ||
um::winuser::{ | ||
IDC_ARROW, IDC_CROSS, IDC_HAND, IDC_HELP, IDC_IBEAM, IDC_NO, IDC_SIZEALL, IDC_WAIT, | ||
}, | ||
}; | ||
|
||
use crate::MouseCursor; | ||
|
||
impl MouseCursor { | ||
pub(crate) fn to_windows_cursor(self) -> PCWSTR { | ||
match self { | ||
MouseCursor::Default => IDC_ARROW, | ||
MouseCursor::Hand | MouseCursor::Pointer => IDC_HAND, | ||
MouseCursor::HandGrabbing | ||
| MouseCursor::Move | ||
| MouseCursor::ZoomIn | ||
| MouseCursor::ZoomOut | ||
| MouseCursor::AllScroll => IDC_SIZEALL, | ||
MouseCursor::Help => IDC_HELP, | ||
MouseCursor::Text | MouseCursor::VerticalText => IDC_IBEAM, | ||
MouseCursor::Working | MouseCursor::PtrWorking => IDC_WAIT, | ||
MouseCursor::NotAllowed | MouseCursor::PtrNotAllowed => IDC_NO, | ||
MouseCursor::Crosshair => IDC_CROSS, | ||
MouseCursor::EResize | ||
| MouseCursor::WResize | ||
| MouseCursor::EwResize | ||
| MouseCursor::ColResize => IDC_SIZEALL, | ||
MouseCursor::NResize | ||
| MouseCursor::SResize | ||
| MouseCursor::NsResize | ||
| MouseCursor::RowResize => IDC_SIZEALL, | ||
MouseCursor::NeResize | MouseCursor::SwResize | MouseCursor::NeswResize => IDC_SIZEALL, | ||
MouseCursor::NwResize | MouseCursor::SeResize | MouseCursor::NwseResize => IDC_SIZEALL, | ||
_ => IDC_ARROW, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod drop_target; | ||
mod keyboard; | ||
mod window; | ||
mod cursor; | ||
|
||
pub use window::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters