Horizontal GtkBoxLayout has (unnecessarily) higher minimum height after baseline patches
This has been found by @sthursfield's QA tests for nautilus, in which the headerbar had misteriously grown 2 pixels taller.
But it can be reproduced with gtk4-widget-factory
(page 3) or anywhere else where an horizontal GtkBox contains 2 children with different baselines.
Note how, in the second picture (after setting :visible
to FALSE
on the first entry using the inspector), the box is 2 pixels shorter (36px vs 34px).
What's happening is that the two child entries have different baselines (at 18 vs at 20), as can be seen using the inspector to set :valign
on both to BASELINE_CENTER
.
Git bisects to e1875876
Reading gtk_box_layout_compute_opposite_size()
, I understand it sets a minimum height that's large enough to align baselines... even if no child is asking for baseline alignment.
Both in nautilus
and gtk4-widget-factory
the children's :valign
are simply defaulting to FILL
, so they get 2px taller than their minimum height.
The GtkBox minimum height being 2 pixels taller than its children's minimum height is a behavior change.