I am trying to write a list of elements, using a personal icon. It works well when my label is on one line, as soon as the label gets more than one line, the icon grows.
Would setting the TextureRect’s expand_mode to Keep Size be a problem for how you’re wanting to use the icon? Like if the icon will consistently be displayed at that one size (in the first image), I’d recommend Keep Size, as well as having the TextureRect’s container sizing (horizontal and vertical) set to Shrink Center so the icon doesn’t display only in the top left corner of the HBox or stretch to sizes you don’t want.
And if you do want the icon to be able to display at different sizes, you could set the TextureRect’s custom_minimum_sizex and y to the size values you want
I have tried as you suggest, it seems it could work, as now the icon keep size, however, as my png is 512, I need it to be displayed as a reasonable height based on line height (about 50%).
I think you need to select Ignore Size in the Expand Mode and control its size with the Custom Minimum Size property, and make sure your Vertical Container Sizing is set to Shrink Center if you want it centered. I don’t really see any better solution.