Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSToolbarItem image scaling

Why is this happening:

As you can see, in the "Allowed Toolbar Items" the image looks fine for the "PHP" toolbar item, and when its actually in the toolbar, it scales weirdly.

Thanks

like image 904
indragie Avatar asked Dec 17 '25 14:12

indragie


1 Answers

Found this in the documentation:

The displayed resolution of an image item is dependent on the sizeMode of the toolbar. You should provide image representations specific to the default, regular and small size modes in a single image that supports multiple image representations such as icns or tiff. The appropriate image representation is automatically displayed for the toolbar's current sizeMode. If an appropriate representation is not available, the toolbar scales the representation to the appropriate size for the current mode, at a cost in performance and appearance. Images that are not square are scaled to fit. An image item’s image is also scaled down and used in the image item’s overflow menu item. (Emphasis added)

This seems you might want to try fiddling with the NSToolbarItem's minSize and maxSize properties.

like image 164
Dave DeLong Avatar answered Dec 19 '25 05:12

Dave DeLong



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!