aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKent Daleng <kent.daleng@nav.no>2025-06-03 19:31:18 +0200
committerGitHub <noreply@github.com>2025-06-03 20:31:18 +0300
commitabac28a65c6c742114ef292221dd26e2a3a2f04b (patch)
tree72451a9fbbd594cbab56f6c15c34e448fb3dadad /src
parenta7186a0441fe866784a601c6192850267802dca5 (diff)
downloadniri-abac28a65c6c742114ef292221dd26e2a3a2f04b.tar.gz
niri-abac28a65c6c742114ef292221dd26e2a3a2f04b.tar.bz2
niri-abac28a65c6c742114ef292221dd26e2a3a2f04b.zip
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 <yalterz@gmail.com> * Improve docs Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com> * 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 <yalterz@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/ui/hotkey_overlay.rs5
1 files changed, 5 insertions, 0 deletions
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))