In OS X Yosemite, Apple introduced a new class NSVisualEffectView
. Currently, this class is undocumented, but we can use it in Interface Builder.
How can I use NSVisualEffectView
in the window's title bar?
Here's example: in Safari, when you scroll, the content appears under the toolbar and titlebar with a vibrance and blur effect.
You need to modify your window's stylemask to include
NSFullSizeContentViewWindowMask
so that its content view can "overflow" into it.You can easily accomplish this by adding this line to your AppDelegate:
If you want it to appear dark, like in FaceTime, you need to also add this line of code:
@sgonzalez's answer forced me to explore
NSWindow.h
file where i foundtitlebarAppearsTransparent
property.So we get:
Also you can setup NSVisualEffectView in IB it will be expanded on titlebar.
Step by step Tutorial with examples:
http://eon.codes/blog/2016/01/23/Chromeless-window/
Setting up translucency:
NSFullSizeContentViewWindowMask
(so that the translucency will also be visible in the titlebar area, leave this out and the titlebar area will be blank)self.titlebarAppearsTransparent = true
(hides the titlebar default graphics).
Also allows you to create chrome-less windows that are translucent: