Skip to content

Prepare for Gtk4: stop using gtk_box_pack_*

Peter Bloomfield requested to merge stop-using-child-properties into master

The gtk_box_pack_{start,end}() functions do not exist in Gtk4, only gtk_box_{append,prepend}(), and these have no parameters corresponding to expand, fill, and padding. Expansion has to be managed by applying the gtk_widget_set_{h,v}expand() functions on the child widget, and filling using the gtk_widget_set_{h,v}align() functions. Likewise, padding is managed by setting the child's margins. In Gtk3, the child can be added with gtk_container_add(), which for Gtk4 just needs to be changed everywhere to gtk_box_append().

The preparation doesn't need to make any functional changes. I rationalized some spacing here and there, mainly by defining HIG_PADDING as 6 in misc.h, and using it everywhere where 6-pixel spacing is used (and replacing some 5-pixel spacings with it, for a more consistent look!). I've checked that most widgets look the same (or better!), but there are some crypto-related widgets that I never see. If there are any glaring problems, they could be fixed in the branch, but minor tweaks could applied in master after merging.

There are many commits, which allow fine-grained checking in the branch, but I suggest squashing them into one for merging.

Merge request reports