From 8629a076a74756af9737e4e07c7523e43f6b3697 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 14 May 2024 21:12:17 -0600 Subject: [PATCH] Tighten up KeyBinding (#11839) After #11795, the context menu was looking a little ridiculous on Mac in vim mode (and the command palette has for a while). Screenshot 2024-05-14 at 20 35 50 Screenshot 2024-05-14 at 20 56 28 A future change would be to have a platform style for vim keybindings so we can render `g A`, but for now this just removes a bunch of (to my eyes at least) unnecessary space: Screenshot 2024-05-14 at 21 01 55 cc @iamnbutler Release Notes: - N/A --- crates/ui/src/components/keybinding.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/crates/ui/src/components/keybinding.rs b/crates/ui/src/components/keybinding.rs index 880d3a3a47..9cec954eda 100644 --- a/crates/ui/src/components/keybinding.rs +++ b/crates/ui/src/components/keybinding.rs @@ -78,16 +78,11 @@ impl RenderOnce for KeyBinding { ) }) .flex_none() - .gap_2() .children(self.key_binding.keystrokes().iter().map(|keystroke| { let key_icon = Self::icon_for_key(keystroke); h_flex() .flex_none() - .map(|el| match self.platform_style { - PlatformStyle::Mac => el.gap_0p5(), - PlatformStyle::Linux | PlatformStyle::Windows => el, - }) .p_0p5() .rounded_sm() .text_color(cx.theme().colors().text_muted) @@ -180,11 +175,9 @@ pub struct KeyIcon { impl RenderOnce for KeyIcon { fn render(self, _cx: &mut WindowContext) -> impl IntoElement { - div().w(rems_from_px(14.)).child( - Icon::new(self.icon) - .size(IconSize::Small) - .color(Color::Muted), - ) + Icon::new(self.icon) + .size(IconSize::Small) + .color(Color::Muted) } }