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:
parent
4bb8a0845f
commit
a46a562dc2
8 changed files with 81 additions and 50 deletions
|
@ -1,4 +1,4 @@
|
|||
use gpui::WindowContext;
|
||||
use gpui::{StyleRefinement, WindowContext};
|
||||
|
||||
use crate::{prelude::*, LabelCommon, LabelLike, LabelSize, LineHeightStyle};
|
||||
|
||||
|
@ -70,6 +70,17 @@ impl Label {
|
|||
}
|
||||
}
|
||||
|
||||
// Style methods.
|
||||
impl Label {
|
||||
fn style(&mut self) -> &mut StyleRefinement {
|
||||
self.base.base.style()
|
||||
}
|
||||
|
||||
gpui::margin_style_methods!({
|
||||
visibility: pub
|
||||
});
|
||||
}
|
||||
|
||||
impl LabelCommon for Label {
|
||||
/// Sets the size of the label using a [`LabelSize`].
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue