ui: Add margin style methods to Label and LabelLike (#14032)

This PR adds margin style methods to the `Label` and `LabelLike`
components.

This allows for callers to provide a margin to these components without
needing to introduce a wrapping `div` to do so.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2024-07-09 17:41:54 -04:00
committed by GitHub
parent 4bb8a0845f
commit a46a562dc2
8 changed files with 81 additions and 50 deletions
+5 -6
View File
@@ -1129,11 +1129,10 @@ impl CompletionsMenu {
None
} else {
Some(
h_flex().ml_4().child(
Label::new(text.clone())
.size(LabelSize::Small)
.color(Color::Muted),
),
Label::new(text.clone())
.ml_4()
.size(LabelSize::Small)
.color(Color::Muted),
)
}
} else {
@@ -1156,7 +1155,7 @@ impl CompletionsMenu {
}
}))
.child(h_flex().overflow_hidden().child(completion_label))
.end_slot::<Div>(documentation_label),
.end_slot::<Label>(documentation_label),
)
})
.collect()