Hey there! I had some time to think about this, and I think there’s an extra additional improvement that can be done along with removing the restriction on the Editor.
The reason for the code warning/editor restriction on the StackPanel children units is because the StackPanel’s height can be adapted to be just the children’s total height. So the StackPanel needs its children to determine its height, but a child with percentage units needs its parent to determine its own height… which creates a circular dependency. But if adaptHeightToChildren
is not true, and we set a height for the StackPanel (like 100px or even 70%), we don’t need to try to determine this height, it was already given to us. So we could remove the warning in this case, and keep it only in the case that the StackPanel has adaptHeightToChildren
true AND it has a descendant with height in percentage. @RaananW do you think this is reasonable?
Of course, even in the case where we keep the code warning, we should improve the GUI Editor to not try to auto-convert it to pixels, and just display some kind of indication that the value has a different behavior. I think we could add a yellow border to the input with a tooltip or text warning. @PatrickRyan what do you think?