Question

Is there any easy way to change the highlight bar color for a standard NSMenu without needing to create custom views for each entry?

All I want is to be able to change the blue highlight color to something of my choice on standard NSMenuItems. I do not need custom views and would like to avoid having to re-implment a simple menu just to change a highlight color.

Was it helpful?

Solution

Just answering my own question so others know what I found.

It is not possible to change the highlight of a standard menu item as the system does some trickery behind the scenes to draw the gradient fill used by the menu item.

Essentially the highlight color is set as normal color, the system then substitutes the "highlight color" with an actual gradient instead of a solid color.

The only real way to do custom highlighting is to create a view based menu and do all the drawing yourself.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top