Daniele Segato
05/31/2021, 12:58 PMLayout
for the first time I've set myself to build a fairly straight forward widget, but with a small circular dependency
2 components (the name is to help imagining but they can be whatever):
• field
• button
the button
can decide its own width but must match field
height
the field
can decide its own height but must leave room for the button
in it's width (maxWidth - button.width
)
the idea is the component will show the field and the button side by side filling width and wrapping height using the field.
As far as I understood I can measure all components only once.
If I measure field
first I can adjust button
width accordingly but I cannot make its height match field
If I measure button
first I can know it's width but I cannot tell it to take as much height as the field
Can someone enlighten me on how to overcome a situation like this with Layout? thanksZach Klippenstein (he/him) [MOD]
05/31/2021, 3:35 PMDaniele Segato
06/01/2021, 11:54 AM