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.
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.