Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | darkpenguin |
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.
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
denxi | 2020-02-08 19:58
I have exactly the same issue, have you found a solution? Looking for a clean answer
henkdewit | 2021-08-30 07:26
You could say I did: Dialog windows should not resize below the minimal size of their children · Issue #455 · godotengine/godot-proposals · GitHub
darkpenguin | 2021-08-30 13:25