UmbraLuminosa / sickle_ui

A widget library built on top of bevy_ui.
Apache License 2.0
205 stars 24 forks source link

Pass PseudoStates to dynamic style builders #37

Closed UkoeHB closed 1 month ago

UkoeHB commented 1 month ago

Alternative implementation to #36

The biggest change here is now the world builder uses &World instead of &mut World, which actually removes a Vec allocation in the theme updater. This affect the utility function get_primary_window(), which can no longer use a query and instead needs to access archetypes directly (which is probably more efficient since you don't need to build an entire QueryState every time it's invoked).

UkoeHB commented 1 month ago

I will update this to use the suggested PseudoWorldStyleBuilder variant, which should reduce diffs a lot.