ui: Render keybinds for disabled actions with disabled color (#27693)

This PR ensures that keybinds for disabled actions in context menus are
also colored according th their disabled state.

### Default

| Current `main` | This PR | 
| --- | --- | 
| <img width="212" alt="main_default"
src="https://github.com/user-attachments/assets/c9f24f4b-dff1-4930-9a3c-07ce1fad516a"
/> | <img width="212" alt="pr_default"
src="https://github.com/user-attachments/assets/fd3db1b8-3a46-4b17-81e7-de66b35b4a79"
/> |

### Vim-Mode

| Current `main` | This PR | 
| --- | --- | 
| <img width="255" alt="main_vim"
src="https://github.com/user-attachments/assets/2845efd3-0109-4e00-af92-203a328d6282"
/> | <img width="255" alt="pr_vim"
src="https://github.com/user-attachments/assets/af073173-30c0-4a60-942f-0f124089c723"
/>|


Release Notes:

- Keybinds in contexts menus will now also be dimmed if the
corresponding action is currently disabled.
This commit is contained in:
Finn Evers 2025-03-31 16:51:17 +02:00 committed by GitHub
parent e6c64ebf7e
commit f6d58f76e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 4 deletions

View file

@ -752,7 +752,7 @@ impl ContextMenu {
KeyBinding::for_action(&**action, window, cx)
})
.map(|binding| {
div().ml_4().child(binding).when(
div().ml_4().child(binding.disabled(*disabled)).when(
*disabled && documentation_aside_callback.is_some(),
|parent| parent.invisible(),
)