"can-shrink" on Picture creates empty occupied space

Setting the “can-shrink” property on a Picture causes it to generate useless space below.


And it seems to work fine with images that are rather wide.

The Picture doesn’t have that empty space it generates, it’s not binded to any widget. It’s simply there.


let image = gtk::Picture::builder()

If I try to resize the window, it occupies that empty space.

So the question is - is there a property I am missing that can fix this, or is there something else I’m doing wrong?


When using a content-fit that preserves aspect ratio like CONTAIN (the default one), there are such weird width-for-height issues like this one, as the picture tries to allocate its height based on its allocated width, with the same ratio as the image.

An easy way to break that behavior would be to pack the Picture in a horizontal GtkBox (as single element).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.