From 8c1bcacd5ee1e683c7cd7345954a7f6fda336305 Mon Sep 17 00:00:00 2001 From: Ben Kunkle Date: Wed, 11 Jun 2025 14:09:23 +0200 Subject: [PATCH] add source column --- crates/settings_ui/src/keybindings.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/settings_ui/src/keybindings.rs b/crates/settings_ui/src/keybindings.rs index 2b51415381856d19d7f6e480f535e2a730e445ce..edd20974b3b250a8a5a1cef1f2673cb69f5661a2 100644 --- a/crates/settings_ui/src/keybindings.rs +++ b/crates/settings_ui/src/keybindings.rs @@ -106,10 +106,15 @@ impl KeymapEditor { .map(|predicate| predicate.to_string()) .unwrap_or_else(|| "".to_string()); + let source = key_binding + .meta() + .map(|meta| settings::KeybindSource::from_meta(meta).name().into()); + processed_bindings.push(ProcessedKeybinding { keystroke_text: keystroke_text.into(), action: key_binding.action().name().into(), context: context.into(), + source, }) } processed_bindings @@ -120,6 +125,7 @@ struct ProcessedKeybinding { keystroke_text: SharedString, action: SharedString, context: SharedString, + source: Option, } impl Item for KeymapEditor { @@ -148,7 +154,7 @@ impl Render for KeymapEditor { .child( Table::new() .interactable(&self.table_interaction_state) - .header(["Command", "Keystrokes", "Context"]) + .header(["Command", "Keystrokes", "Context", "Source"]) .uniform_list( "keymap-editor-table", row_count, @@ -160,8 +166,7 @@ impl Render for KeymapEditor { binding.action.clone(), binding.keystroke_text.clone(), binding.context.clone(), - // TODO: Add a source field - // binding.source.clone(), + binding.source.clone().unwrap_or_default(), ]; // fixme: pass through callback as a row_cx param