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.

settings_ui: Render font picker options in their own font family (#64199)

Mizan57df168fe7bb
diff --git a/crates/settings_ui/src/components/font_picker.rs b/crates/settings_ui/src/components/font_picker.rs
index 86a7afed7d3..5f0766b33e3 100644
--- a/crates/settings_ui/src/components/font_picker.rs
+++ b/crates/settings_ui/src/components/font_picker.rs
@@ -158,13 +158,18 @@ impl PickerDelegate for FontPickerDelegate {
_cx: &mut Context<FontPicker>,
) -> Option<Self::ListItem> {
let font_match = self.filtered_fonts.get(ix)?;
+ let font_name: SharedString = font_match.string.clone().into();
Some(
ListItem::new(ix)
.inset(true)
.spacing(ListItemSpacing::Sparse)
.toggle_state(selected)
- .child(Label::new(font_match.string.clone()))
+ .child(
+ div()
+ .font_family(font_name.clone())
+ .child(Label::new(font_name)),
+ )
.into_any_element(),
)
}