Search code examples
macosnsbuttonnstoolbar

How to perfectly mimic toolbar buttons as in Finder, Safari, or other default apps?


I'm trying to create an application that would be as standard as possible in terms of style. An image is worth a thousand words: I can't figure out how to make my buttons the same size as in Apple's programs such as Safari or Finder. screen capture

As you can see, the sizing I've set in interface builder don't seem to match the size the buttons get when I run the app, but maybe that part doesn't speak in pixels but in points or something? Also, textured rounded button has only width editable, but not height.

In this case, these are NSButtons, but I guess I'll have a similar problem with other control types...


Solution

  • I found it out! The problem was with neither of these two parts outlined in the screenshot, but in the "Toolbar" item, higher in the hierarchy.

    There is a Size attribute in the Attributes inspector which defaults to Small, but you can set it to Regular instead, and then the buttons get the same sizing as in Finder and all.