From abac28a65c6c742114ef292221dd26e2a3a2f04b Mon Sep 17 00:00:00 2001 From: Kent Daleng Date: Tue, 3 Jun 2025 19:31:18 +0200 Subject: add option to hide unbound actions in hotkey overlay (#1618) * add option to hide unbound actions in hotkey overlay * fix config test, add some docs * Add kdl language hint Co-authored-by: Ivan Molodetskikh * Improve docs Co-authored-by: Ivan Molodetskikh * hide_unbound -> hide_not_bound * forgot to rename in wiki * filter actions before calling format * use any instead of contains * retain instead of filter --------- Co-authored-by: Ivan Molodetskikh --- src/ui/hotkey_overlay.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ui/hotkey_overlay.rs b/src/ui/hotkey_overlay.rs index 1430a9d6..7042d2c0 100644 --- a/src/ui/hotkey_overlay.rs +++ b/src/ui/hotkey_overlay.rs @@ -285,6 +285,11 @@ fn render( } } + if config.hotkey_overlay.hide_not_bound { + // Only keep actions that have been bound + actions.retain(|&action| binds.iter().any(|bind| bind.action == *action)) + } + let strings = actions .into_iter() .filter_map(|action| format_bind(binds, mod_key, action)) -- cgit