keymap_ui: Improve keybind display in menus (#34587)

Closes #ISSUE

Defines keybindings for `keymap_editor::EditBinding` and
`keymap_editor::CreateBinding`, making sure those actions are used in
tooltips.

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Finn <dev@bahn.sh>
This commit is contained in:
Ben Kunkle 2025-07-17 10:10:07 -05:00 committed by GitHub
parent b0eac4267d
commit 948c1f22bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 75 additions and 57 deletions

View file

@ -972,12 +972,10 @@ impl ContextMenu {
.children(action.as_ref().and_then(|action| {
self.action_context
.as_ref()
.map(|focus| {
.and_then(|focus| {
KeyBinding::for_action_in(&**action, focus, window, cx)
})
.unwrap_or_else(|| {
KeyBinding::for_action(&**action, window, cx)
})
.or_else(|| KeyBinding::for_action(&**action, window, cx))
.map(|binding| {
div().ml_4().child(binding.disabled(*disabled)).when(
*disabled && documentation_aside.is_some(),