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.

Correctly use the base element in `HighlightedLabel` (#7397)

Marshall Bowersce62404e24e0
diff --git a/crates/ui/src/components/label/highlighted_label.rs b/crates/ui/src/components/label/highlighted_label.rs
index 41866bd10af..88174f48959 100644
--- a/crates/ui/src/components/label/highlighted_label.rs
+++ b/crates/ui/src/components/label/highlighted_label.rs
@@ -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))
}
}
diff --git a/crates/ui/src/components/label/label_like.rs b/crates/ui/src/components/label/label_like.rs
index f08ff1bf833..cddd849b89d 100644
--- a/crates/ui/src/components/label/label_like.rs
+++ b/crates/ui/src/components/label/label_like.rs
@@ -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,