I am working on implementing tabs for my application. Everything is working well except I can’t figure out how to draw the tabs in a lighter shade of gray when the window resigns main status. I am successfully receiving a NSWindowDidBecomeMainNotification and redrawing the tab bar but I am not sure how to calculate the new gray color for the tabs. I am currently using images for all drawing. I tried drawing a semi-transparent layer above to the entire tab bar to make it lighter but it didn’t seem to work. I could probably set an opacity value for each image that I use but that seems less than ideal. I also couldn’t find any information in the Apple docs about this. What is the best practice in this case?
I am working on implementing tabs for my application. Everything is working well except
Share
What you could do is make the tabs draw in code, and then simply not draw a background. Let the window’s background, active or inactive, show through.
You might also consider switching to PSMTabBarControl, a reusable tab bar class that’s already written and in use in several apps. (And I assume that you’ve dismissed NSTabView as not the look you’re going for.)