From 54d74a9617d806c65c683260b76e96e37e6851a3 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 10 Mar 2025 17:12:43 +0800 Subject: [PATCH] kdb: Add min width 20px to Kdb. (#700) image --- crates/story/src/text_story.rs | 1 + crates/ui/src/kbd.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/story/src/text_story.rs b/crates/story/src/text_story.rs index c0b44824..e7c9155f 100644 --- a/crates/story/src/text_story.rs +++ b/crates/story/src/text_story.rs @@ -238,6 +238,7 @@ impl Render for TextStory { .child(Kbd::new(Keystroke::parse("cmd-ctrl-t").unwrap())) .child(Kbd::new(Keystroke::parse("escape").unwrap())) .child(Kbd::new(Keystroke::parse("backspace").unwrap())) + .child(Kbd::new(Keystroke::parse("/").unwrap())) .child(Kbd::new(Keystroke::parse("enter").unwrap())), ), ) diff --git a/crates/ui/src/kbd.rs b/crates/ui/src/kbd.rs index ab8133a6..407f13e0 100644 --- a/crates/ui/src/kbd.rs +++ b/crates/ui/src/kbd.rs @@ -60,7 +60,9 @@ impl RenderOnce for Kbd { .bg(cx.theme().background) .py_0p5() .px_1() - .rounded_md() + .min_w_5() + .text_center() + .rounded_sm() .line_height(relative(1.)) .text_xs() .child(Self::format(&self.stroke))