Change color of title bar

Hello,

i'm new here and have a question.

How can i change the color of the title bar for a OSX app?

I want to have a dark title bar.


Thanks.


Greetings

Stephan

I think it is not possible. Unfortunately.


Unless maybe you can rebuild a title bar in the window …

Thank you for your answer.


Then i will try to rebuild the Title bar.


Thank you.


Greetings from germany.

Yes, this is possible. Just set the appearance property on the window, like this:

window.appearance = NSAppearance(named: NSAppearanceNameVibrantDark)

Hello,

were i hav to put the code in?

Thank you

I´m not so familar with swift jet.

Stephan

If you have a custom window controller, I'd place the code inside windowDidLoad(); if you have a standard window controller with a custom content view controller, I'd do it in viewDidAppear(); if you have neither of those, then perhaps the app delegate, but you really should do it in a place that's directly related to the window.

Does it change only title's color or the whole window background ?

It changes the entire coloration of the window. And as a bonus, everywhere NSColor.labelColor() and its friends are used, they will automatically take on their light appearances.

Change color of title bar
 
 
Q