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

Implement a Selector API in Masonry #680

Open
PoignardAzur opened this issue Oct 16, 2024 · 0 comments
Open

Implement a Selector API in Masonry #680

PoignardAzur opened this issue Oct 16, 2024 · 0 comments

Comments

@PoignardAzur
Copy link
Contributor

Right now, our only way to get a specific widget in the widget tree is id-based methods.

This requires us to create widgets with pre-allocated IDs, which is cumbersome in a couple of ways. And because WidgetId carries no type information, we need to downcast the widget we retrieve this way.

A better API would be one based around a typed Selector<W> type; search methods could take that type as an input (which could have optional attributes like id, substring, etc), and would returned a typed WidgetRef/WidgetMut with the downcast done internally.

Doing so would probably make a lot of unit tests easier to read and write.

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

1 participant