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:
1 parent
5d5d62689f
commit
76d5d90da0
2 files changed
+2
-3
No files matched your search
@@ -79,8 +79,7 @@ impl RenderOnce for HighlightedLabel {
|
||||
let mut text_style = cx.text_style().clone();
|
||||
text_style.color = self.base.color.color(cx);
|
||||
|
||||
LabelLike::new()
|
||||
.size(self.base.size)
|
||||
self.base
|
||||
.child(StyledText::new(self.label).with_highlights(&text_style, highlights))
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ pub trait LabelCommon {
|
||||
|
||||
#[derive(IntoElement)]
|
||||
pub struct LabelLike {
|
||||
pub(crate) size: LabelSize,
|
||||
size: LabelSize,
|
||||
line_height_style: LineHeightStyle,
|
||||
pub(crate) color: Color,
|
||||
strikethrough: bool,
|
||||
|
||||
Reference in new issue
Block a user