BUG: 398356
Former we calculated a button size to fit the whole widget vertically (if the layout is horizontal) and vice versa but what if we don't have enough space to fit the widget horizontally?
We have a 100x100 field. Okay, let height = 90 (margins, etc)
Then, first button 90x90, spacer 5x90 (still okay), and one more button 90x90 (oops, fail: the widget is 185x90)
Now we check the second dimension and shrink the buttons when necessary.
First button 45x45, spacer 5x45, second button 45x45. The widget if 95x45, and it fits now.
So, we have to subtract spacer width from parent width and divide it by 2, because we have two buttons and check if it's smaller than height. If so, we fit in the width.
Same thing when layout is vertical.