Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
keymap_editor: Adjust some items of the UI (#42876)
Danilo Leal4092e81ada23
diff --git a/crates/keymap_editor/src/keymap_editor.rs b/crates/keymap_editor/src/keymap_editor.rsindex b5b9f92a491..58a2a5d044f 100644--- a/crates/keymap_editor/src/keymap_editor.rs+++ b/crates/keymap_editor/src/keymap_editor.rs@@ -958,12 +958,14 @@ impl KeymapEditor {let context_menu = ContextMenu::build(window, cx, |menu, _window, _cx| {menu.context(self.focus_handle.clone())+ .when(selected_binding_is_unbound, |this| {+ this.action("Create", Box::new(CreateBinding))+ }).action_disabled_when(selected_binding_is_unbound,"Edit",Box::new(EditBinding),)- .action("Create", Box::new(CreateBinding)).action_disabled_when(selected_binding_is_unbound,"Delete",diff --git a/crates/keymap_editor/src/ui_components/keystroke_input.rs b/crates/keymap_editor/src/ui_components/keystroke_input.rsindex 5f85e5124f8..f1f583be7a6 100644--- a/crates/keymap_editor/src/ui_components/keystroke_input.rs+++ b/crates/keymap_editor/src/ui_components/keystroke_input.rs@@ -636,18 +636,24 @@ impl Render for KeystrokeInput {)}})- .child(- IconButton::new("clear-btn", IconName::Backspace)- .shape(IconButtonShape::Square)- .tooltip(Tooltip::for_action_title(- "Clear Keystrokes",- &ClearKeystrokes,- ))- .when(!is_focused, |this| this.icon_color(Color::Muted))- .on_click(cx.listener(|this, _event, window, cx| {- this.clear_keystrokes(&ClearKeystrokes, window, cx);- })),- ),+ .when(is_recording, |this| {+ this.child(+ IconButton::new("clear-btn", IconName::Backspace)+ .shape(IconButtonShape::Square)+ .tooltip(move |_, cx| {+ Tooltip::with_meta(+ "Clear Keystrokes",+ Some(&ClearKeystrokes),+ "Hit it three times to execute",+ cx,+ )+ })+ .when(!is_focused, |this| this.icon_color(Color::Muted))+ .on_click(cx.listener(|this, _event, window, cx| {+ this.clear_keystrokes(&ClearKeystrokes, window, cx);+ })),+ )+ }),)}}diff --git a/crates/ui/src/components/data_table.rs b/crates/ui/src/components/data_table.rsindex 4a1f4939cca..a505281cf3f 100644--- a/crates/ui/src/components/data_table.rs+++ b/crates/ui/src/components/data_table.rs@@ -641,11 +641,10 @@ pub fn render_table_row<const COLS: usize>(.map_or([None; COLS], |widths| widths.map(Some));let mut row = h_flex()- .h_full().id(("table_row", row_index))- .w_full()- .justify_between()+ .size_full().when_some(bg, |row, bg| row.bg(bg))+ .hover(|s| s.bg(cx.theme().colors().element_hover.opacity(0.6))).when(!is_striped, |row| {row.border_b_1().border_color(transparent_black())