GtkPicture requests too much height
GtkPicture
exhibits some strange resizing behaviour that I don't think can possibly be correct.
To demonstrate this, I wrote an example program: main.cpp. The program simply creates this widget layout:
Despite the button being the expanding widget, the picture takes up all available space:
Upon further examination, it actually turns out the picture isn't using up that extra space. The picture is just the black rectangle, and the empty space around it is its parent box.
So it appears the picture is requesting a much larger height that it needs, then not actually using that height. The height request appears to be derived from the width assuming the picture expands arbitrarily far, preserving its aspect ratio. But it isn't set to expand.
Given the layout properties I've set, I would expect the program to look something like this:
This is also supported by the docs for GtkPicture
, which say it's possible to stop it from filling all available space:
Gtk.Widget:halign and Gtk.Widget:valign can be used to make sure the paintable doesn't fill all available space but is instead displayed at its original size.
Tested with GTK 4.16