Trouble fitting a GtkPicture inside of a list view

Hi there!

I have a GtkListView that it’s used to show chat messages and I’m trying to show the photos attached to this messages. Each item is made of a vertical GtkBox that contains both the GtkPicture for the photo and a GtkLabel for the catpion below the photo. I’d like the GtkPicture to automatically expand to the width of the box (keeping it’s aspect ratio), but setting hexpand to the photo, it just doesn’t do anything for some reason. The only way I found to do this is to manually set the size request of the photo, but then the problem is that when resizing the window, the picture will have empty borders because it will shrink to fit the content, but the size request is still the original one.

Any help is really appreciated :slight_smile:

I guess you could make the Picture a child of an AspectFrame

Unfortunately it doesn’t seem to work as I wanted to. The picture is still super small by default, the hexpand/vexpand doesn’t do anything and the only way to increase the size is to manually set the requested size :confused:

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