Skip to content

Commit

Permalink
Don't show submenu shortcuts for command options
Browse files Browse the repository at this point in the history
User-facing changes:
Previously, sub-menus like `File -> New` and `Game Object -> Add Component` showed the same shortcut on every option item. This changeset turns this behavior off.

Technical notes:
I implemented the fix by only showing the key combo if the menu item does not define custom user data since this is what differentiates the options from each other. It was wrong to show the key combinations on such options because invoking a command using a key combination does not supply this user data anyway.

Fixes #7442
  • Loading branch information
vlaaad committed Mar 29, 2023
1 parent 9257a31 commit ea68932
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/src/clj/editor/ui.clj
Expand Up @@ -1258,7 +1258,7 @@
(user-data! menu-item ::menu-item-id id)
(when command
(.setId menu-item (name command)))
(when (some? key-combo)
(when (and (some? key-combo) (nil? user-data))
(.setAccelerator menu-item key-combo))
(when icon
(.setGraphic menu-item (wrap-menu-image (icons/get-image-view icon 16))))
Expand Down

0 comments on commit ea68932

Please sign in to comment.