Change cursor shape for disabled widgets#20548
Change cursor shape for disabled widgets#20548alice-i-cecile merged 4 commits intobevyengine:mainfrom
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.
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.
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.
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.