Skip to content
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

[feature request] include druid-enum in druid-widget-nursery #103

Open
richard-uk1 opened this issue Jan 19, 2022 · 2 comments
Open

[feature request] include druid-enum in druid-widget-nursery #103

richard-uk1 opened this issue Jan 19, 2022 · 2 comments

Comments

@richard-uk1
Copy link
Collaborator

Now we have a derive crate (for Prism), we could include the widget generator for enums in druid-enum. This would make it more discoverable, as there isn't really a solution for displaying enums in druid or druid-widget-nursery at present (is this claim correct?).

@ratmice
Copy link
Contributor

ratmice commented Jan 19, 2022

I haven't looked at druid-enum as much as prism, but they seem pretty overlapping to me in their functionality both displaying enums.

And while i've done a bunch of things with prism, like using the List widget, with a collection of prisms, and deriving prism for a struct which holds an enum, beyond using it with plain old enums.

I haven't delved as deeply into druid-enum, but it doesn't present an interface outside of the derive macro you can manually derive so at least won't work for this struct case, though I don't see why druid-enum wouldn't work for the collection case as well.

So I kind of see prism as a bit more flexible even though prism requires a separate widget that knows about prisms.

a note on the enum-like struct prism I manually derived...

In particular my struct has 2 fields, and 1 enum with 2 unit variants, allowing you to switch which struct field acts as top-level widget. While the backend of my program needs access to both fields from the top-level, because it receives data pertaining to both.

@maurerdietmar
Copy link
Collaborator

maurerdietmar commented Jan 22, 2022

Prism is a bit to complex for me, so I would like to have a simpler option like druid-enum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants