The System Preferences app feature a combined title bar and toolbar with vertically centered buttons and the title. I am trying to mimic this exactly in my app. I have been able to combine the title bar and toolbar using Interface Builder (on the NSWindow check Title Bar and Unified Title and Toolbar), but this does not center the content vertically. I discovered via this question you can simply set the window's titleVisibility
to NSWindowTitleHidden
which will vertically center the stoplight buttons. Unfortunately this of course hides the title. How can one vertically center content in the unified titlebar/toolbar and also show the window's title just like System Preferences - either in IB or programmatically?
Asked
Active
Viewed 1,398 times
5

Jordan H
- 52,571
- 37
- 201
- 351
-
Any status update on this? – Dalmazio Jul 09 '15 at 22:03
-
@DalmazioBrisinda Just posted the only solution I found – Jordan H Jul 09 '15 at 23:50
2 Answers
1
I ended up setting titleVisibility
to NSWindowTitleHidden
and manually created an NSView
that contains an NSTextField
that mimics the standard title appearance, providing that to the window's addTitlebarAccessoryViewController
method. Still would like to find a better solution to use the default title appearance, if possible.

Jordan H
- 52,571
- 37
- 201
- 351
-
-
1but this doesn't work for document apps cause document title has more native functionality – fnc12 Jan 01 '21 at 09:40
-1
I used WAYAppStoreWindow on GitHub to do this. I created a fork of the WAYWindow subproject to vertically centre the document title since this wasn't supported. This means any applied themes/appearances are honoured.

Dalmazio
- 1,835
- 2
- 23
- 40