-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to change the Mouse cursor #577
Comments
I'm writing implementation step for this in case someone wants to implement this:
A good example of a pull request that adds a property and an enum is I added the "good first issue" tag because despite having many steps, none are really difficult. And I would gladly review pull requests that only do part of these steps. |
So if I wanted to change the cursor when hovering over an arbitrary SVG path, I could do something like: TouchArea {
mouse-cursor: rust-callback();
} And have Also, it would be great if there was a way to specify whether the mouse event should be consumed. This doesn't have any effect in native apps but matters for WebAssembly. If mouse events are always consumed then you cannot scroll past an embedded app on mobile, for example. |
Right, you could do
This is a separate issue. The native code kind of do that. But we maybe don't tell |
Would you be interested in having support for it? I can only see it being useful on the web but you write in your README that "web support is currently limited to demo purposes." |
Yes, we would accept pull request. We don't focus on the web right now because we have priorities, and in order to have good support of the web, we probably should write another backend that uses the DOM and not jsut draw everything in a canvas. But we still see web support as a good thing to have. |
Okay, I'll look into what it would take to write a PR for this. For context, I'd love to use sixtyfps for computational geometry (https://rgeometry.org) and 3b1b style animations (https://github.com/reanimate/reanimate/). Probably way outside of your intended use-cases but it would make my life a lot easier if I could make it work. |
Hey. I'd like to work on this issue if that's ok. |
@lukas-jung that'd be great, just let me know if you have any questions |
I've got a first version running with both backends. there are some problems however. Currently i'm replacing no-drop with not-allowed and the unidirectional resizes with their bidirectional counterpart. However there is a second problem with the move cursor: since 'move' is a rust keyword I cannot use it as an enum variant! Or perhaps the rust side of the enums should always use idiomatic camel case variant names and then the snake case .60 enum variants must be properly mapped to those. |
@lukas-jung nice to hear! please make a PR. (Someone else also made a PR for this at #708 but it is not finished yet.)
Then we just have to use some fallback or placeholder, I think your choices make sense.
Can you try r#move ? If that is too much of a problem we can also leave it out until we find a solution for that. |
Discussed in #576
We should add the ability to change the mouse cursor in TouchArea (or possibly on all element?)
I'm the
mouse-cursor:
name here, instead ofcursor:
like in CSS in case we extend the property to be used on all elements.The value should probably be an enum consisting of the keywords from the CSS spec.
Support for custom cursor could be added later.
The text was updated successfully, but these errors were encountered: