Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a "within window" transparent/blurry title bar using a custom base color in Yosemite?

I've been playing around with NSVisualEffectViews in Yosemite and transparent titlebars but I was wondering if it's possible to have a custom title bar, with my own base color (not that gray), that would act like Apple's.
Here's my current NSWindow: enter image description here
I achieved this look by setting the following code on my custom NSWindowController:

self.window.styleMask = self.window.styleMask | NSFullSizeContentViewWindowMask;
self.window.titleVisibility = NSWindowTitleHidden;
self.window.titlebarAppearsTransparent = YES;

That blue color is just a custom NSView that's painting its rect with that particular color. The content below it is a NSTableView.
So, the goal was to actually have my titlebar to work like, let's say, Maps but instead of having the "base" color as the gray color, my "base" color would be that blue one and when the NSTableView scrolls, that content appears below my title bar.

Any ideas on how to achieve this? Thanks

like image 382
Pedro Vieira Avatar asked Nov 01 '22 21:11

Pedro Vieira


1 Answers

Have you tried setting a blue color with a transparency of, e.g., 0.75 in the blue view, and a NSVisualEffectViewunderneath it?

like image 147
Raffael Avatar answered Nov 08 '22 04:11

Raffael