mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
Correctly use the base element in HighlightedLabel
(#7397)
This PR updates the `HighlightedLabel` to correctly render its base element, which is the one that receives the styling properties, instead of rendering a new `LabelLike`. Release Notes: - N/A
This commit is contained in:
parent
8911e1b365
commit
ce62404e24
@ -79,8 +79,7 @@ impl RenderOnce for HighlightedLabel {
|
|||||||
let mut text_style = cx.text_style().clone();
|
let mut text_style = cx.text_style().clone();
|
||||||
text_style.color = self.base.color.color(cx);
|
text_style.color = self.base.color.color(cx);
|
||||||
|
|
||||||
LabelLike::new()
|
self.base
|
||||||
.size(self.base.size)
|
|
||||||
.child(StyledText::new(self.label).with_highlights(&text_style, highlights))
|
.child(StyledText::new(self.label).with_highlights(&text_style, highlights))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ pub trait LabelCommon {
|
|||||||
|
|
||||||
#[derive(IntoElement)]
|
#[derive(IntoElement)]
|
||||||
pub struct LabelLike {
|
pub struct LabelLike {
|
||||||
pub(crate) size: LabelSize,
|
size: LabelSize,
|
||||||
line_height_style: LineHeightStyle,
|
line_height_style: LineHeightStyle,
|
||||||
pub(crate) color: Color,
|
pub(crate) color: Color,
|
||||||
strikethrough: bool,
|
strikethrough: bool,
|
||||||
|
Loading…
Reference in New Issue
Block a user