-
-
Couldn't load subscription status.
- Fork 4.2k
Change cursor shape for disabled widgets #20548
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
Change cursor shape for disabled widgets #20548
Conversation
|
I think function names should change because they don't just change colors anymore. |
|
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
I agree, can you update this? Can you also add this PR to the feathers release notes? |
| let cursor_shape = match disabled { | ||
| true => bevy_window::SystemCursorIcon::NotAllowed, | ||
| false => bevy_window::SystemCursorIcon::Pointer, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a problem to match on a bool I guess, but it's not idiomatic and looks a bit odd:
| let cursor_shape = match disabled { | |
| true => bevy_window::SystemCursorIcon::NotAllowed, | |
| false => bevy_window::SystemCursorIcon::Pointer, | |
| }; | |
| let cursor_shape = if disabled { | |
| bevy_window::SystemCursorIcon::NotAllowed | |
| } else { | |
| bevy_window::SystemCursorIcon::Pointer | |
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but I saw that it was already done like that in other parts of the crate so for consistency I just followed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me.
On it. |
|
Is this good? |
|
Thanks! Nice work :) |
Objective
Solution
EntityCursorre-insertion inset_*_colorsfunctions with corresponding cursor shape depending on whether the widget is disabled or not.Testing
feathersexample.