Fixed two causes identified for the regression introduced in D15450:
- In IdealLayout, buttonSpacing not being considered while checking if a
button should be shrinked. Changed this to properly account for spacing.
- minimumSize in Ideal Layout calls doVerticalLayout with a height of zero,
the property is always 0. Re-implemented (also previously commented as buggy)
by accumulating the also newly added `minimumSize` in the IdealToolButton, along with
setting the size policy to Preferred for correctness.
- Boilerplate to avoid this crash in the future, if the calculation still missed something,
or possibly due to some exotic theme settings.
BUG: 399025