Everything works as expected when using [toolbarItem setMaxSize: NSMakeSize(24,24)]
- but this function is deprecated now.
I tried to set the layout constraints on the items's view but that does not have any effect.
NSView *itemView = toolbarItem.view;
itemView.translatesAutoresizingMaskIntoConstraints = NO;
NSLayoutConstraint *widthConstraint = [itemView.widthAnchor constraintEqualToConstant: 24];
NSLayoutConstraint *heightConstraint = [itemView.heightAnchor constraintEqualToConstant: 24];
widthConstraint.active = YES;
heightConstraint.active = YES;