Skip to content

Commit 7839980

Browse files
Martin Hjulstad BednarLGUG2Z
authored andcommitted
feat(shortcuts): show all hotkey bindings
- Removed command filtering logic from the shortcuts UI. - All hotkey bindings are now shown regardless of command. - Improved UI with hint text for the filter input.
1 parent 6416c0b commit 7839980

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

komorebi-shortcuts/src/main.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use eframe::egui::ViewportBuilder;
22
use std::path::PathBuf;
3-
use whkd_core::HotkeyBinding;
43
use whkd_core::Whkdrc;
54

65
#[derive(Default)]
@@ -58,21 +57,18 @@ impl eframe::App for Quicklook {
5857
ui.label("Filter");
5958
ui.add(
6059
eframe::egui::text_edit::TextEdit::singleline(&mut self.filter)
60+
.hint_text("Filter by command...")
6161
.background_color(ctx.style().visuals.faint_bg_color),
6262
);
6363
ui.end_row();
64-
ui.end_row();
6564

6665
for binding in &whkdrc.bindings {
67-
if is_komorebic_binding(binding) {
68-
let keys = binding.keys.join(" + ");
69-
if self.filter.is_empty()
70-
|| binding.command.contains(&self.filter)
71-
{
72-
ui.label(keys);
73-
ui.label(&binding.command);
74-
ui.end_row();
75-
}
66+
let keys = binding.keys.join(" + ");
67+
if self.filter.is_empty() || binding.command.contains(&self.filter)
68+
{
69+
ui.label(keys);
70+
ui.label(&binding.command);
71+
ui.end_row();
7672
}
7773
}
7874
}
@@ -100,7 +96,3 @@ fn main() {
10096
)
10197
.unwrap();
10298
}
103-
104-
fn is_komorebic_binding(binding: &HotkeyBinding) -> bool {
105-
binding.command.starts_with("komorebic")
106-
}

0 commit comments

Comments
 (0)