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

Marshall Bowers created

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

Change summary

crates/ui/src/components/label/highlighted_label.rs | 3 +--
crates/ui/src/components/label/label_like.rs        | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)

Detailed changes

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))
     }
 }

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,