diff --git a/assets/icons/backspace.svg b/assets/icons/backspace.svg new file mode 100644 index 0000000000..f7f1cf107a --- /dev/null +++ b/assets/icons/backspace.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/icons/delete.svg b/assets/icons/delete.svg new file mode 100644 index 0000000000..1068cb65f2 --- /dev/null +++ b/assets/icons/delete.svg @@ -0,0 +1,4 @@ + + + + diff --git a/crates/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs index b0eed86250..0c618f2915 100644 --- a/crates/ui2/src/components/icon.rs +++ b/crates/ui2/src/components/icon.rs @@ -32,6 +32,7 @@ pub enum Icon { AtSign, AudioOff, AudioOn, + Backspace, Bell, BellOff, BellRing, @@ -50,6 +51,7 @@ pub enum Icon { CopilotError, CopilotDisabled, Dash, + Delete, Disconnected, Ellipsis, Envelope, @@ -115,6 +117,7 @@ impl Icon { Icon::AtSign => "icons/at-sign.svg", Icon::AudioOff => "icons/speaker-off.svg", Icon::AudioOn => "icons/speaker-loud.svg", + Icon::Backspace => "icons/backspace.svg", Icon::Bell => "icons/bell.svg", Icon::BellOff => "icons/bell-off.svg", Icon::BellRing => "icons/bell-ring.svg", @@ -133,6 +136,7 @@ impl Icon { Icon::CopilotError => "icons/copilot_error.svg", Icon::CopilotDisabled => "icons/copilot_disabled.svg", Icon::Dash => "icons/dash.svg", + Icon::Delete => "icons/delete.svg", Icon::Disconnected => "icons/disconnected.svg", Icon::Ellipsis => "icons/ellipsis.svg", Icon::Envelope => "icons/feedback.svg", diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index f0de9891a7..6f63885489 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -65,19 +65,15 @@ impl KeyBinding { } fn icon_for_key(keystroke: &Keystroke) -> Option { - let mut icon: Option = None; - - if keystroke.key == "left".to_string() { - icon = Some(Icon::ArrowLeft); - } else if keystroke.key == "right".to_string() { - icon = Some(Icon::ArrowRight); - } else if keystroke.key == "up".to_string() { - icon = Some(Icon::ArrowUp); - } else if keystroke.key == "down".to_string() { - icon = Some(Icon::ArrowDown); + match keystroke.key.as_str() { + "left" => Some(Icon::ArrowLeft), + "right" => Some(Icon::ArrowRight), + "up" => Some(Icon::ArrowUp), + "down" => Some(Icon::ArrowDown), + "backspace" => Some(Icon::Backspace), + "delete" => Some(Icon::Delete), + _ => None, } - - icon } pub fn new(key_binding: gpui::KeyBinding) -> Self {