Control (Node) does not report correct size when used in container

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

Hi,
I am new to Godot so I dont know if it is a Bug or if I do something wrong.

The Problem

Container Tree:

  • root
    – HBoxContainer
    — Button1
    — Control
    ---- ButtonBuggy
    — Button2

As intended all the buttons get arranged under each other as close as possible. But the BuggyButton inside Control does not say how much space it needs and so the Control.size.y is automaticly set to 0.


MyProject/Why I need it

I wanted to create somekind of subview. I like the idea of containers (also i am used to it from Qt). Inside a subview, there is should be a Node2d (as Local Map or something that can be drawn) and some gui Elements which i would rather place with anchor and margin.
The main view should set the size of the subviews. So far i created the subview with a viewport and all gui elemtens. As root Element of the subview I used a Control. If I just play this scene everything is as I wished.
The problem is that these subviews overlap if I try to arrange them in my main view with BoxContainers.


Solution

Set the min size for the Control-Node.
I had expected that the ControlNode takes the size of the child into consideration. (as Qt does it).