diff options
author | 2019-10-27 02:59:25 +0100 | |
---|---|---|
committer | 2019-10-27 02:59:25 +0100 | |
commit | 82c2aa6bfd1ed90b32b303a900e13b2c07bc69ba (patch) | |
tree | 962dea4ef08023ec78cf8e9b4c93d716225bd57a | |
parent | e2668b882a8115fd0afcd32373edb180492908b1 (diff) | |
download | iced-82c2aa6bfd1ed90b32b303a900e13b2c07bc69ba.tar.gz iced-82c2aa6bfd1ed90b32b303a900e13b2c07bc69ba.tar.bz2 iced-82c2aa6bfd1ed90b32b303a900e13b2c07bc69ba.zip |
Align items properly inside a `Scrollable`
-rw-r--r-- | core/src/widget/scrollable.rs | 4 | ||||
-rw-r--r-- | native/src/widget/scrollable.rs | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/core/src/widget/scrollable.rs b/core/src/widget/scrollable.rs index ef3bc1db..1bad8555 100644 --- a/core/src/widget/scrollable.rs +++ b/core/src/widget/scrollable.rs @@ -6,7 +6,6 @@ pub struct Scrollable<'a, Element> { pub height: Length, pub max_height: Length, pub align_self: Option<Align>, - pub align_items: Align, pub content: Column<Element>, } @@ -17,7 +16,6 @@ impl<'a, Element> Scrollable<'a, Element> { height: Length::Shrink, max_height: Length::Shrink, align_self: None, - align_items: Align::Start, content: Column::new(), } } @@ -87,7 +85,7 @@ impl<'a, Element> Scrollable<'a, Element> { /// /// [`Scrollable`]: struct.Scrollable.html pub fn align_items(mut self, align_items: Align) -> Self { - self.align_items = align_items; + self.content = self.content.align_items(align_items); self } diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index e0983e6e..95e8c74d 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -31,8 +31,7 @@ where .max_width(self.content.max_width) .height(self.height) .max_height(self.max_height) - .align_self(self.align_self) - .align_items(self.align_items); + .align_self(self.align_self); style.0.flex_direction = stretch::style::FlexDirection::Column; |