Sonoma Issue on NSMenuItem keyEquivalent value

82 views Asked by At

I want to add an keyEquivalent to NSMenuItem with font "Kanit-Light". Till now it was working fine, But in Sonoma OS there is an issue that in the keyEquivalent the KeyEquivalentModifierMask (command symbol) is not aligned properly. It looks proper only when the system font is used for NSMenuItem. How can I solve this issue?

This is how it looks in Sonoma OS for Quit keyEquivalent

The code I have used is

let paraStyle: NSMutableParagraphStyle = NSMutableParagraphStyle()
paraStyle.lineBreakMode = .byTruncatingTail
    
var titleAttributes: [NSAttributedString.Key : Any]
titleAttributes = [.font:NSFont.settingsLightFont(withSize:14.0),.paragraphStyle:paraStyle]

quitMenuItem.attributedTitle = NSMutableAttributedString(attributedString: NSAttributedString(string: NSLocalizedString("Quit", comment: ""), attributes: titleAttributes))

Here for the keyEquivalent of the menu item, I have specified the value in the nib file

0

There are 0 answers