Expose additional mouse::Interaction
cursors
#2551
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a few more common mouse interaction cursors to
interaction.rs
, namely:Since the
Cell
selector is a bit niche, here is a screenshot of what it looks like in Excel. My use case is building a spreadsheet app, so users would expect this cursor to be there.I take it
ZoomOut
andMove
are pretty standard and need no specific use case.There's an argument to be made that
iced
could just expose all of the cursors fromwinit
and let the users figure it out, even if some of the cursors are very unusual. I'm not making that argument so I have only added those cursors whose inclusion was more immediately defensible IMHO but open to suggestions.Admittedly I have not tested the specific resizing cursors because I'm on MacOS and they don't work, but naturally everything compiles and runs fine. They just default to the standard cursor, but I tested other cursors from
winit
and they were fine (including, for example, sizing westward, which is not in this PR) so I'm confident nothing's wrong with the code per se.FYI this
winit
issue is being tracked here: rust-windowing/winit#3724