title: Changing NSToolbarItem image size in Mac Catalyst
body: <p>When adding custom <code>NSToolbarItem</code> using <code>NSToolbarDelegate</code> I can't set the image of the icons. The problem comes when using default ones (SplitView or Share), which have a different size:<a href="https://i.stack.imgur.com/wuS7q.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wuS7q.png" alt="Example of NSToolbarItem with different image size" /></a></p>
  <p>Here's the example code for two of the items, one is the share one and the other is to add a new item. Please also note that in the share example I'm using <code>NSSharingServicePickerToolbarItem</code> and even I'm overriding the image it's still using the 'system' one.</p>
  <pre><code>        case .new:
              let item = NSToolbarItem(itemIdentifier: itemIdentifier)
              item.image = UIImage(systemName: &quot;plus&quot;)
              item.label = &quot;New Card&quot;
              item.action = #selector(ViewController.didTapCreateNewToolbarButton(_:))
              item.target = nil
              toolbarItem = item
          case .share:
              let item = NSSharingServicePickerToolbarItem(itemIdentifier: itemIdentifier)
              item.image = UIImage(systemName: &quot;square.and.arrow.up&quot;)
              item.label = &quot;Share&quot;
              item.action = #selector(ViewController.didTapShareToolbarButton(_:))
              item.target = nil
              
              toolbarItem = item
  </code></pre>
  <p>I've tried using <code>UIImage.SymbolConfiguration(pointSize: 8, weight: .medium)</code> but the result is the same.
  I've also tried this solution: <a href="https://developer.apple.com/forums/thread/131364" rel="nofollow noreferrer">https://developer.apple.com/forums/thread/131364</a> but the result is an image taking the whole space available (bigger and pixelated).</p>
  <p>So, how can I change the size/styles of those buttons? Would be great to be able to change both the system and my custom ones.</p>
  <p>EDIT 1: This issue only appears when removing the title, which makes the toolbar more small in height and resizes properly the system buttons but not the other ones:</p>
  <pre><code>if let titlebar = windowScene.titlebar {
    titlebar.toolbar = toolbar
    titlebar.toolbarStyle = .automatic
    titlebar.titleVisibility = .hidden // &lt;-- THIS
  }
  </code></pre>