Skip to content

custom_container/mycontainer.cc: Tidy up measure()

Daniel Boles requested to merge dboles/mycontainer-tidy-measure into master

I was thinking of making this use the new overload of measure() I just added to gtkmm, but it's probably not worth requiring gtkmm 4.14 for the relatively small gain we'll get from that. However, this other tidying I found while testing that out does seem worth doing. 😸


  • Move dummy_*_baseline to point of use, renamed to ignore.
  • Avoid unneeded height_per_child; just divide for_size in-place.
  • Deduplicate two loops, one for each possible Orientation.
  • Use std::max(), instead of reinventing it.
  • Donʼt redundantly count nvis_children manually, in one of those loops!

Merge request reports