Fix missing buffer font features in Blame UI, Hover Popover and Markdown Preview (#44657)
- Fix missing font features in `git_ui::blame_ui::GitBlameRenderer.render_blame_entry` - Fix missing buffer font features in `markdown_preview::markdown_renderer` - Update the way that the markdown style is built for hover popovers so that, for code blocks, the buffer font features are used. - Introduce `gpui::Styled.font_features` to allow callers to also set the font's features, similar to how `gpui::Styled.font_family` already exists. Relates to #44209 Release Notes: - Fixed wrong font features in Blame UI, Hover Popover and Markdown Preview
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use crate::{
|
||||
self as gpui, AbsoluteLength, AlignContent, AlignItems, BorderStyle, CursorStyle,
|
||||
DefiniteLength, Display, Fill, FlexDirection, FlexWrap, Font, FontStyle, FontWeight,
|
||||
GridPlacement, Hsla, JustifyContent, Length, SharedString, StrikethroughStyle, StyleRefinement,
|
||||
TextAlign, TextOverflow, TextStyleRefinement, UnderlineStyle, WhiteSpace, px, relative, rems,
|
||||
DefiniteLength, Display, Fill, FlexDirection, FlexWrap, Font, FontFeatures, FontStyle,
|
||||
FontWeight, GridPlacement, Hsla, JustifyContent, Length, SharedString, StrikethroughStyle,
|
||||
StyleRefinement, TextAlign, TextOverflow, TextStyleRefinement, UnderlineStyle, WhiteSpace, px,
|
||||
relative, rems,
|
||||
};
|
||||
pub use gpui_macros::{
|
||||
border_style_methods, box_shadow_style_methods, cursor_style_methods, margin_style_methods,
|
||||
@@ -630,6 +631,14 @@ pub trait Styled: Sized {
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the font features of this element and its children.
|
||||
fn font_features(mut self, features: FontFeatures) -> Self {
|
||||
self.text_style()
|
||||
.get_or_insert_with(Default::default)
|
||||
.font_features = Some(features);
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the font of this element and its children.
|
||||
fn font(mut self, font: Font) -> Self {
|
||||
let Font {
|
||||
|
||||
Reference in New Issue
Block a user