Align items properly inside a Scrollable

This commit is contained in:
Héctor Ramón Jiménez 2019-10-27 02:59:25 +01:00
parent e2668b882a
commit 82c2aa6bfd
2 changed files with 2 additions and 5 deletions

View file

@ -6,7 +6,6 @@ pub struct Scrollable<'a, Element> {
pub height: Length, pub height: Length,
pub max_height: Length, pub max_height: Length,
pub align_self: Option<Align>, pub align_self: Option<Align>,
pub align_items: Align,
pub content: Column<Element>, pub content: Column<Element>,
} }
@ -17,7 +16,6 @@ impl<'a, Element> Scrollable<'a, Element> {
height: Length::Shrink, height: Length::Shrink,
max_height: Length::Shrink, max_height: Length::Shrink,
align_self: None, align_self: None,
align_items: Align::Start,
content: Column::new(), content: Column::new(),
} }
} }
@ -87,7 +85,7 @@ impl<'a, Element> Scrollable<'a, Element> {
/// ///
/// [`Scrollable`]: struct.Scrollable.html /// [`Scrollable`]: struct.Scrollable.html
pub fn align_items(mut self, align_items: Align) -> Self { pub fn align_items(mut self, align_items: Align) -> Self {
self.align_items = align_items; self.content = self.content.align_items(align_items);
self self
} }

View file

@ -31,8 +31,7 @@ where
.max_width(self.content.max_width) .max_width(self.content.max_width)
.height(self.height) .height(self.height)
.max_height(self.max_height) .max_height(self.max_height)
.align_self(self.align_self) .align_self(self.align_self);
.align_items(self.align_items);
style.0.flex_direction = stretch::style::FlexDirection::Column; style.0.flex_direction = stretch::style::FlexDirection::Column;