summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-27 01:37:40 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-10-27 01:37:40 +0200
commit63c10b67ab213c5971313743fde566bd5c0f0c15 (patch)
tree6d1af1007f759e41ef26d48a2a99f91fb0136e5b /core
parent09bd2c46c06eba72da40852d82a52e7353cc9e9b (diff)
downloadiced-63c10b67ab213c5971313743fde566bd5c0f0c15.tar.gz
iced-63c10b67ab213c5971313743fde566bd5c0f0c15.tar.bz2
iced-63c10b67ab213c5971313743fde566bd5c0f0c15.zip
Remove `Scrollable::justify_content` method
Diffstat (limited to 'core')
-rw-r--r--core/src/widget/scrollable.rs47
1 files changed, 20 insertions, 27 deletions
diff --git a/core/src/widget/scrollable.rs b/core/src/widget/scrollable.rs
index 4e5c4ad0..ef3bc1db 100644
--- a/core/src/widget/scrollable.rs
+++ b/core/src/widget/scrollable.rs
@@ -1,9 +1,10 @@
-use crate::{Align, Column, Justify, Length, Rectangle};
+use crate::{Align, Column, Length, Rectangle};
#[derive(Debug)]
pub struct Scrollable<'a, Element> {
pub state: &'a mut State,
pub height: Length,
+ pub max_height: Length,
pub align_self: Option<Align>,
pub align_items: Align,
pub content: Column<Element>,
@@ -14,6 +15,7 @@ impl<'a, Element> Scrollable<'a, Element> {
Scrollable {
state,
height: Length::Shrink,
+ max_height: Length::Shrink,
align_self: None,
align_items: Align::Start,
content: Column::new(),
@@ -30,77 +32,68 @@ impl<'a, Element> Scrollable<'a, Element> {
self
}
- /// Sets the padding of the [`Column`].
+ /// Sets the padding of the [`Scrollable`].
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn padding(mut self, units: u16) -> Self {
self.content = self.content.padding(units);
self
}
- /// Sets the width of the [`Column`].
+ /// Sets the width of the [`Scrollable`].
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn width(mut self, width: Length) -> Self {
self.content = self.content.width(width);
self
}
- /// Sets the height of the [`Column`].
+ /// Sets the height of the [`Scrollable`].
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn height(mut self, height: Length) -> Self {
self.height = height;
self
}
- /// Sets the maximum width of the [`Column`].
+ /// Sets the maximum width of the [`Scrollable`].
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn max_width(mut self, max_width: Length) -> Self {
self.content = self.content.max_width(max_width);
self
}
- /// Sets the maximum height of the [`Column`] in pixels.
+ /// Sets the maximum height of the [`Scrollable`] in pixels.
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn max_height(mut self, max_height: Length) -> Self {
- self.content = self.content.max_height(max_height);
+ self.max_height = max_height;
self
}
- /// Sets the alignment of the [`Column`] itself.
+ /// Sets the alignment of the [`Scrollable`] itself.
///
/// This is useful if you want to override the default alignment given by
/// the parent container.
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn align_self(mut self, align: Align) -> Self {
self.align_self = Some(align);
self
}
- /// Sets the horizontal alignment of the contents of the [`Column`] .
+ /// Sets the horizontal alignment of the contents of the [`Scrollable`] .
///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn align_items(mut self, align_items: Align) -> Self {
self.align_items = align_items;
self
}
- /// Sets the vertical distribution strategy for the contents of the
- /// [`Column`] .
+ /// Adds an element to the [`Scrollable`].
///
- /// [`Column`]: struct.Column.html
- pub fn justify_content(mut self, justify: Justify) -> Self {
- self.content = self.content.justify_content(justify);
- self
- }
-
- /// Adds an element to the [`Column`].
- ///
- /// [`Column`]: struct.Column.html
+ /// [`Scrollable`]: struct.Scrollable.html
pub fn push<E>(mut self, child: E) -> Scrollable<'a, Element>
where
E: Into<Element>,