Migrate clustered_decals example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3)#25064
Conversation
38b1bd9 to
2351028
Compare
clustered_decal example to use FeathersRadioButton and FeathersNumberInputclustered_decal example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3)
322d7b0 to
985c90d
Compare
|
Just FYI I have planned major work for |
| } | ||
|
|
||
| /// Creates a basic feathers theme props for the radio buttons. | ||
| pub fn basic_radio_button_theme() -> ThemeProps { |
There was a problem hiding this comment.
context: I had to move theme out since there was a compiler complaint about an unused function. clustered_decals uses the dark theme since it looked ok to use for this particular example
| )); | ||
| ]), | ||
| number_input("Scale Multiplier", 1.0, 0.05..10., AppNumberInput::Scale), | ||
| number_input("Roll (-π to π)", 0.0, -PI..PI, AppNumberInput::Roll), |
There was a problem hiding this comment.
This should be an inclusive range
number_input("Roll (-π to π)", 0.0, -PI..=PI, AppNumberInput::Roll),There was a problem hiding this comment.
So a bit oddly, HardLimit in Feathers only takes a Range and not an inclusive one, and you can’t convert an inclusive range into a regular old Range.
So I tried to compromise by just adding epsilon to the end, but for roll specifically, if you go a little above PI, switch decals, and then switch back, the value gets turned into (essentially) -PI because the roll is recalculated to be within the range of -PI and PI. My opinion is that the number changing like that is undesired UX.
So for those reasons, I’m going to keep this as is. However, the fact that HardLimit doesn’t have the option to accept an inclusive Range is a legitimate thing to ask about and question whether we should do something about it outside of this PR
There was a problem hiding this comment.
I'm open to revisiting hard and soft limit.
There was a problem hiding this comment.
Interesting! That is surprising. Is it worth filing a separate issue?
There was a problem hiding this comment.
Yes please if you’d like to create it 😄 No problem/question is too small for an issue I say
There was a problem hiding this comment.
Sounds good! I'll try to do that tonight or tomorrow when I have time. 🙂
There was a problem hiding this comment.
Gentle reminder @taearls :) I'm merging now, so it's easy to forget.
| ], | ||
| )); | ||
| ]), | ||
| number_input("Scale Multiplier", 1.0, 0.05..10., AppNumberInput::Scale), |
There was a problem hiding this comment.
number_input("Scale Multiplier", 1.0, 0.05..=10., AppNumberInput::Scale),clustered_decal example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3)clustered_decals example to use FeathersRadioButton and FeathersNumberInput (Phase 5 Item 3)
Objective
Solution
ssrexample migration, withFeathersRadioButtons made via theradio.rsutil and some more customFeathersNumberInputs(with greater learning on my part on what could possibly be extracted as common logic forFeathersNumberInputs in examples).Testing
cargo run --example clustered_decals --features="pbr_clustered_decals bevy_feathers”has better UX improvement when compared to main.Showcase
Video of the example
Screen.Recording.2026-07-19.at.12.49.55.AM.mov
Don’t mind the slower drag speed for the number inputs — it moves slower when screen recording for some reason