macOS: Remove multi-keystroke rendering in title of menu item (#26448)
Closes #25483 Currently, macOS doesn't support showing multi-keystroke shortcuts in menu items. We can use an attributed string to differentiate them, but that breaks consistency with traditional shortcuts. This PR removes the hack of concatenating the multi-keystroke shortcut to the title, as it looked a bit janky. Release Notes: - N/A
This commit is contained in:
parent
1cfbfc199c
commit
e175878008
1 changed files with 1 additions and 14 deletions
|
@ -347,20 +347,7 @@ impl MacPlatform {
|
|||
msg_send![item, setAllowsAutomaticKeyEquivalentLocalization: NO];
|
||||
}
|
||||
item.setKeyEquivalentModifierMask_(mask);
|
||||
}
|
||||
// For multi-keystroke bindings, render the keystroke as part of the title.
|
||||
else {
|
||||
use std::fmt::Write;
|
||||
|
||||
let mut name = format!("{name} [");
|
||||
for (i, keystroke) in keystrokes.iter().enumerate() {
|
||||
if i > 0 {
|
||||
name.push(' ');
|
||||
}
|
||||
write!(&mut name, "{}", keystroke).unwrap();
|
||||
}
|
||||
name.push(']');
|
||||
|
||||
} else {
|
||||
item = NSMenuItem::alloc(nil)
|
||||
.initWithTitle_action_keyEquivalent_(
|
||||
ns_string(&name),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue