Problem with the size of Button(s) when it have one or more children

Hello everyone :),

We have a little issue with our usages of Buttons object in UiToolkit.
Indeed when we use a simple instantiation of a button, it take the size of the text set on it (like the first screenshot below)

But when we begin to complexifie a button with one or more children in it, the size of the text are not use anymore. And If children are more smaller than the text … we just don’t see the text anymore (like the second screenshot below)

Have you any ideas or tips to avoid this problem ? (Or to force the button to have a minimum height and width set on the text size)

Thanks

Hi, my recommendation is to not put any children under Button as it was not designed to support this usage. The button is more like a label with specific styling and click logic. Instead you can easily create your own button element and customize it as you want with no restrictions. You can register a callback to the ClickEvent to handle mouse interactions.

Thk for the recommendation, we create our own buttons as you said :slight_smile:
(sorry for the delay of my answer ^^)