How can I change the height of an NSMenuItem? When I change the font of a menu, an NSMenuItem automatically resizes to just fit the title, leaving no space above or below the title. It looks very cramped.
Looks like this:
Want it to look like this:
I've tried a million tweaks related to the attributed title of the menu items, but to no avail. I also don't want to use the view property of the menu items because I want to keep the highlight. Any other ideas?
Edit: This is what I'd like (more or less), but based on NSMenu, not redoing it from the ground up.
You can set an empty 1-pixel wide image with the desired height:
NSImage *image=[[NSImage alloc]initWithSize:NSMakeSize(1,30)];
[menuItem setImage:image];
Obviously you end up with titles that are offset 1 pixel to the right, though that may be acceptable if uniformly applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With