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

Add Layout operation to Container #1911

Closed
wants to merge 1 commit into from
Closed

Conversation

13r0ck
Copy link
Member

@13r0ck 13r0ck commented Jun 12, 2023

An operation that will return a message to the application with the dimensions of the widget as a Rectangle.

container::get_layout(CONTAINER_ID.clone(), Message::GotLayout)

The only slightly unusual think about this operation is that creating the operation requires the return message. But this API is the same as Command::Perform, and operations are just Commands, so I believe this should be fine.

@13r0ck
Copy link
Member Author

13r0ck commented Jun 12, 2023

I can add the layout operation to other widgets before this is merged. Just pushing this now to make sure implementation is ok, before doing the extra work.

An operation that will return a message to the application with
the dimensions of the widget as a `Rectangle`.

`container::get_layout(CONTAINER_ID.clone(), Message::GotLayout)`

The only slightly unusual think about this operation is that
creating the operation requires the return message. This API
is the same as `Command::Perform`, and operations are just
`Commands`, so I believe this should be fine.
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.

2 participants