UmbraLuminosa / sickle_ui

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

Add default implementation for UiContext #28

Closed UkoeHB closed 1 month ago

UkoeHB commented 1 month ago

I need to make themes, but don't need to use contexts via the UiContext trait (I manually set the target entity for custom dynamic styles). Having a default implementation makes it easier to write new themes.

eidloi commented 1 month ago

There is a derive macro UiContext, does that not cover your use case?

eidloi commented 1 month ago

There is also a DefaultTheme but that actually defaults to None, and is useful for cases where you want to explicitly add theming to elements but want no default fallback.

UkoeHB commented 1 month ago

There is a derive macro UiContext, does that not cover your use case?

Ah did not know about that. I added a commit for re-exporting the macros crate. I think it's still useful to have default implementations for the trait fields.

eidloi commented 1 month ago

that works for me! I really need to sort out the exports, it's getting to be a tangled mess.