iced_lazy Responsive Widget doesn't emit Message #1347
maxslarsson
started this conversation in
General
Replies: 1 comment
-
If you want to cache the pixels of an |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an existing issue for this?
Is this issue related to iced?
What happened?
To render the pixels for an Image widget, I need to have a way of getting the current width and height of the Image widget. Wrapping it with the Responsive widget from iced_lazy, and using Length::Fill, fixes the issue, but for some reason this widget takes a lambda function and gives the size as an argument to the lambda. The problem is I need to save the Size of the Responsive widget since I am recalculating the pixels only when the user presses a button (and I don't want to do it every time view is called). However, since I am using pure widgets I don't have a mutable reference to self and can't save the Size. Why does the Responsive widget not just emit a Message, like Button and TextInput and most other widgets, so the update function can handle the message and rerender the pixel data? Am I misunderstanding where I should generate the pixels for an image?
What is the expected behavior?
The Responsive widget takes a message to produce with the size of the widget. Some ideas of what it could look like: Button or TextInput.
or
Version
0.4
Operative System
macOS
Do you have any log output?
No response
Beta Was this translation helpful? Give feedback.
All reactions