From 0043b0d9579fbc17e1362964a4f3922ebe1605eb Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 12 Sep 2024 11:32:24 -0400 Subject: [PATCH] editor: Render documentation popovers using UI font (#17761) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR updates the documentation popovers to render non-code using the UI font: Screenshot 2024-09-12 at 11 10 46 AM Screenshot 2024-09-12 at 11 21 12 AM Requested by @davidbarsky. Release Notes: - Changed documentation popovers to render Markdown prose using the UI font instead of the buffer font. Code blocks still using the buffer font. --- crates/editor/src/hover_popover.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/editor/src/hover_popover.rs b/crates/editor/src/hover_popover.rs index 0dc2f09839..adbb5899ff 100644 --- a/crates/editor/src/hover_popover.rs +++ b/crates/editor/src/hover_popover.rs @@ -518,19 +518,22 @@ async fn parse_blocks( let rendered_block = cx .new_view(|cx| { let settings = ThemeSettings::get_global(cx); + let ui_font_family = settings.ui_font.family.clone(); let buffer_font_family = settings.buffer_font.family.clone(); - let mut base_style = cx.text_style(); - base_style.refine(&TextStyleRefinement { - font_family: Some(buffer_font_family.clone()), + + let mut base_text_style = cx.text_style(); + base_text_style.refine(&TextStyleRefinement { + font_family: Some(ui_font_family.clone()), color: Some(cx.theme().colors().editor_foreground), ..Default::default() }); let markdown_style = MarkdownStyle { - base_text_style: base_style, - code_block: StyleRefinement::default().mt(rems(1.)).mb(rems(1.)), + base_text_style, + code_block: StyleRefinement::default().my(rems(1.)).font_buffer(cx), inline_code: TextStyleRefinement { background_color: Some(cx.theme().colors().background), + font_family: Some(buffer_font_family), ..Default::default() }, rule_color: Color::Muted.color(cx),