Probably GridLayoutBase needs to be improved here, if it doesn’t infer the size through the nesting (probably because of the Aspect). Although aspect constraints are resolved differently than other sizes so it could be that it’s not possible.
Thanks for the insights! Do you have any suggestions? I would like to use nested GridLayout because I wanted to put several heatmap and Colorbar pairs, each pair residing in its dedicated GridLayout, but if this makes the margin control difficult, maybe I should put all heatmaps and Colorbars in a single GridLayout.
Probably easier to do it in a single one, yes. At least for now. In principle you could first call resize_to_layout like logic on the inner GridLayout so it has a fixed size and then on the outer one.