When does size_flags_stretch_ratio apply?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Burt

Hello there.

I’m having trouble getting two controls to be side-by-side in a container and take up different portions of space. The size_flags_stretch_ratio seems exactly what I’m looking for, but I can’t find a scenario where it has any effect.

Example scene

I would like the first text box in Field 2 to take up more space than the second, without expanding the entire GridContainer’s width. I can set a min-size on the first LineEdit, but that expands the entire GridContainer.

I’ve tried setting the Size Flags on both LineEdit and LineEdit2 to “Expand”, and then set the stretch ratio of LineEdit to “2”, as per the documentation for size_flags_stretch_ratio . This didn’t make any changes at all. I’ve also tried including “Fill” with “Expand” but again, no effect at all. All other controls in the scene have their default size flags set (with only “Fill”).

Did you figure this one out? I’m having the exact same problem, I wonder if a parent container is stopping this from working but I don’t think so.

gothrond | 2021-03-10 03:24