-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
box_shadow
example with adjustable settings
#19345
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
Conversation
792458e
to
a1e8f7c
Compare
- Replaces the previous static example with a single, central node with adjustable settings as per issue suggestion. - Implements button-based setting adjustments. Slider widgets don't seem available yet. - Improved overall aesthetics of the example - Dynamically recolors shadows for visual clarity when increasing shadow count. - Adjustable Settings: - Shape selection - Shadow X/Y offset, blur, spread, and count - Added Reset button to restore default settings
a1e8f7c
to
91b39f8
Compare
box_shadow
example with adjustable settings
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.
Really nice. Just made a few suggestions but overall it's a huge improvement over the old example.
Co-authored-by: ickshonpe <[email protected]>
Co-authored-by: ickshonpe <[email protected]>
442c267
to
7a18fa5
Compare
Thanks for the feedback and review! Suggestions already applied for the most part. Just working out the button pressed repeat logic. |
make shape label transparent while keeping others gray for improved UI clarity
- Track last pressed button and press time in a resource - Add system to trigger button actions at a repeat interval when held - Improves UX for increment/decrement and shape navigation buttons
68dc3e1
to
cafaf79
Compare
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.
Very fancy! I'm looking forward to replacing this complexity with some native widgets in the future, but I think this is a step in the right direction.
IMO it's much more important for this example to allow users to explore the box shadow options interactively, rather than simply learning how to add a box shadow.
Absolutely, native widgets and possibly even a template for interactive examples using some set of these widgets would definitely reduce complexity and furthermore enable consistency across the examples in the long-term. Especially if the objective is to make more examples interactive down the road.
I also feel that is the right choice. |
The downside is that the CI screenshot tests no longer tests all the different shadow combinations |
@oracle58 ping me when merge conflicts are resolved and I'll get this in :) |
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.
IMO, this and other example widgetification attempts are a bit premature. This is adding a lot of example code that must be maintained and is likely to change soon.
If we want to do this, I have some suggested changes.
- rename `spawn_setting_children` -> `build_setting_row` - remove bg color from value labels (made them seem like input fields) - Fix settings panel positioning: bottom and left margins between screen and panel are uneven - use `resource_changed` rather than `is_changed` for shape and shadow settings - The `button_color_system` now uses With<SettingsButton> in its query filter, so it only runs for buttons with a `SettingsButton` component. - Refactor setting value updates to use new `SettingType` enum component instead of fragile label string comparisons - Add Samples as a controllable setting in the UI panel
a55ca05
to
5394519
Compare
- Replace tuple struct syntax with BorderColor::all(...) in shape node and settings panel. - Resolves E0423 error due to struct construction changes in Bevy UI. - consistent formatting - Fmt imports
5394519
to
e1d7b2c
Compare
I think I have the suggested changes applied @rparrett
@alice-i-cecile |
I 100% see where you're coming from, but I'd like to merge a couple of these now, mostly so we can compare them as a baseline. Thanks for the thorough feedback as always :) |
# Objective Minimal effort to address feedback here: #19345 (comment) more thoroughly. ## Solution - Remove hardcoded label string comparisons and make more use of the new enum added during review - Resist temptation to let this snowball this into a huge refactor - Maybe come back later for a few other small improvements ## Testing `cargo run --example box_shadow`
Objective
box_shadow
example #19240Solution
The disadvantage of this solution is that the old example code would have probably been easier to digest as the new example is quite bloated in comparison. Alternatively I could also just implement labels and fix aesthetics of the old example without adding functionality for adjustable settings, but I personally feel like interactive examples are more engaging to users.
Testing
cargo run --example box_shadow
and functionality of all features of the example.Showcase