feat(flex-row): add justify_content method

This commit is contained in:
Michael Aaron Murphy 2024-05-29 23:55:50 +02:00 committed by Michael Murphy
parent 1bc3012165
commit 7a6421a3e2
3 changed files with 11 additions and 1 deletions

View file

@ -27,6 +27,9 @@ pub struct FlexRow<'a, Message> {
width: Length,
/// Sets the max width
max_width: f32,
/// Defines how the content will be justified.
#[setters(into)]
justify_content: Option<crate::widget::JustifyContent>,
}
impl<'a, Message> FlexRow<'a, Message> {
@ -38,6 +41,7 @@ impl<'a, Message> FlexRow<'a, Message> {
row_spacing: 4,
width: Length::Shrink,
max_width: f32::INFINITY,
justify_content: None,
}
}
@ -83,6 +87,7 @@ impl<'a, Message: 'static + Clone> Widget<Message, crate::Theme, Renderer>
self.padding,
f32::from(self.column_spacing),
f32::from(self.row_spacing),
self.justify_content,
&mut tree.children,
)
}