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

Replace some layout proc-macros with by-example macros over named widgets #476

Merged
merged 21 commits into from
Feb 15, 2025

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Feb 13, 2025

The primary change is to replace the following proc-macros with by-example macros in kas_widgets over named widgets:

  • column!, row!, list!, grid!, aligned_column!, aligned_row!
  • Added frame! macro and method fn Frame::with_background
  • Remove button! macro
  • Added Float widget and replaced float! proc-macro
  • Support align and pack method call on string literals in collection! to match widget layout syntax

Additional changes:

  • Remove support for 'name named storage fields which no longer have any usage
  • Add fn AdaptWidget::with_state to construct an Adapt node
  • Make macro-generation of fn Tile::rect optional, requiring usage of widget_set_rect! within Layout::set_rect
  • Remove feature recursive-layout-widgets (no longer applicable to anything)

Also restrict widget_set_rect! expansion to fn
Layout::set_rect, allow optional definition of fn Tile::rect
and adjust GripPart code.
If needed, these could be replaced with by-example marcros
in kas_widgets, perhaps using feature macro_metavar_expr.
This feature is no longer applicable to anything
@dhardy dhardy merged commit 2efcc4c into master Feb 15, 2025
5 checks passed
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.

1 participant