kdb: Add min width 20px to Kdb. (#700)

<img width="358" alt="image"
src="https://github.com/user-attachments/assets/824a0cdd-e03b-49f4-bde6-b77ae0ab48cd"
/>
This commit is contained in:
Jason Lee 2025-03-10 17:12:43 +08:00 committed by GitHub
parent 4db0fd5819
commit 54d74a9617
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View file

@ -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())),
),
)

View file

@ -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))