Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

ui: Fix keybind sizing for non-default UI font sizes (#24708)

Finn Eversea8da43c6bb6
diff --git a/crates/ui/src/components/keybinding.rs b/crates/ui/src/components/keybinding.rs
index 4391c9061ba..50083c251a5 100644
--- a/crates/ui/src/components/keybinding.rs
+++ b/crates/ui/src/components/keybinding.rs
@@ -230,7 +230,9 @@ pub struct Key {
impl RenderOnce for Key {
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
let single_char = self.key.len() == 1;
- let size = self.size.unwrap_or(px(14.).into());
+ let size = self
+ .size
+ .unwrap_or_else(|| TextSize::default().rems(cx).into());
div()
.py_0()