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

Secondary elements #49

Open
watt opened this issue Jan 22, 2020 · 2 comments
Open

Secondary elements #49

watt opened this issue Jan 22, 2020 · 2 comments

Comments

@watt
Copy link
Collaborator

watt commented Jan 22, 2020

SwiftUI has a concept of secondary views, which are attached to a parent view but do not play a part in layout. Handy for e.g. putting a badge on an icon without changing the layout of the icon.

This can almost be replicated in Blueprint with Overlays, but really needs custom layout in order to let the secondary element take any size or position without affecting the parent element. Blueprint should provide a dedicated element for this pattern.

@bencochran
Copy link
Collaborator

Could you sketch what you imagine this API looks like?

@watt
Copy link
Collaborator Author

watt commented Mar 13, 2020

Oops, forgot to respond to this. I imagine a wrapper that simply takes two elements, and "attaches" the second to the first.

Attached(
    element: primaryElement,
    attachment: secondaryElement
)

Here primaryElement is wrapped and laid out normally, and secondaryElement is overlaid, but unlike Overlay, the layout of secondaryElement can not affect primaryElement or the Attached element.

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

2 participants