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:
parent
b0eac4267d
commit
948c1f22bb
4 changed files with 75 additions and 57 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue