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

Trait revision part 3: merge Component and Layout traits; put layout storage in widget_core!() #314

Merged
merged 16 commits into from
May 5, 2022

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented May 5, 2022

Quality of life improvements:

  • replace #[widget_core] core: CoreData field with core: widget_core!()
  • extend macro layout syntax to support all layouts previously using the layout visitor (except Grid)

Details:

  • layout storage is now placed in extra fields of widget_core!(), which is generated where necessary; these fields may have explicit names where external access is desired
  • make Layout identical to Component trait, then replace the latter with the former
  • rename kas::layout::Layout to Visitor; this should perhaps be removed but is currently used for implementation of layout macro syntax

Single-item macro layout currently uses component: self.foo syntax: ideally this would just be self.foo, but there is a small issue here. (Drawing a widget assigns that widget's id to DrawMgr, but components don't have an id.)

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

Successfully merging this pull request may close these issues.

None yet

1 participant