0 votes

I have a WindowDialog with a few buttons in a VBoxContainer. There are expandable separators between buttons, so the container is resized along with the window.

the problem is, I can resize the window below the minimal size of the container, and the buttons are "hovering in the air".

I know there is "Min Size" for the window, but that's a poor solution - what is I want to add more buttons and forget to change it? Or add them in runtime.

Is it possible to set "do not resize the window below the size of its children"? Or at least get the container's current minimal size - not the specified "Min Size", which is (0,0) , but the actual current (runtime) minimal size, below which it can not resize because of the buttons on it.

asked Feb 8 in Engine by darkpenguin (17 points)

There's probably a way to do it automatically that I don't know about, but what you could do is have a script that runs after the game has launched and all buttons have been instanced, that measures the min size the window needs to be by looking at the dimensions of all its children, and sets Min Size based on that

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.