NSMatrix within NSToolbarItem. Wrong space on Big Sur.

I have set up a NSToolbarItem containing a NSMatrix (2 buttons to toggle). On Catalina it looks well. On Big Sur, I get an unwanted space between the two (smaller) buttons. My settings:

NSToolbarItem
Size: Explicit
Minimum Width 74
Minimum Height 37
Maximum Width 74
Maximum Height 37

NSMatrix
Cell Size 37 x 37
Cell Spacing 0 x 0
Automatic Resizes Cells: YES
Auto Recalculates Cell Size: NO
Control Size: Regular
View Frame: 74 x 37
Layout: Autoresizing Mask (All)

The two icons size are 74 x 74 pixels.



The toolbar height on Big Sur is smaller, so I end up with the single button size as 30 x 30 pixels and a matrix size as 60 x 30 plus an unwanted 14 pixels space between the two buttons.

If I set the Minimum size to 60 x 30 pixels, it works well on Big Sur, but I get a smaller NSMatrix on Catalina.

So, how to fix this trouble?
At launch I get this Log message:

NSToolbarItem.minSize and NSToolbarItem.maxSize methods are deprecated. Usage may result in clipping of items. It is recommended to let the system measure the item automatically using constraints.

But how to add constraints on IB to the NSToolbarItem only? The whole XIB file has no constraints.
I have added

[matrixGroup setTranslatesAutoresizingMaskIntoConstraints:NO];
[matrixGroup addConstraint:[NSLayoutConstraint constraintWithItem:matrixGroup
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
toItem:matrixGroup
attribute:NSLayoutAttributeHeight
multiplier:2.0
constant:0.0]];

and now the gap between the two buttonsCells has gone. Well.
Anyway, when I display the toolbar with the icons only (without text), these NSMatrix(s) within the NSToolbarItem(s) look higher than the simple NSButtons within the NSToolbarItem(s).

Why do the NSButton and NSMatrix behave differently when within the NSToolbarItem?

Incidentally, the tooltips associated to each NSMatrix's buttonCell don't show up.

I know NSMatrix has been deprecated, so, which object should I use to toggle between two buttons on the toolbar? I tried segments but they look smaller and flat.


NSMatrix within NSToolbarItem. Wrong space on Big Sur.
 
 
Q