summaryrefslogtreecommitdiffstats
path: root/core/src/length.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-31 11:37:41 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-12-31 11:37:41 +0100
commite98471d5b60d34e54defaba6e5979ff881e380e6 (patch)
tree428d923a092bc710697762e048d7a95505cc7085 /core/src/length.rs
parentfb9cc0262b30a953e8188897b74abb5106ea1fd8 (diff)
parent26de688e68347e1f6e388d01014eac89cea71afa (diff)
downloadiced-e98471d5b60d34e54defaba6e5979ff881e380e6.tar.gz
iced-e98471d5b60d34e54defaba6e5979ff881e380e6.tar.bz2
iced-e98471d5b60d34e54defaba6e5979ff881e380e6.zip
Merge branch 'master' into feature/custom-styling
Diffstat (limited to 'core/src/length.rs')
-rw-r--r--core/src/length.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/src/length.rs b/core/src/length.rs
index 10873e89..06d8cf0a 100644
--- a/core/src/length.rs
+++ b/core/src/length.rs
@@ -4,6 +4,15 @@ pub enum Length {
/// Fill all the remaining space
Fill,
+ /// Fill a portion of the remaining space relative to other elements.
+ ///
+ /// Let's say we have two elements: one with `FillPortion(2)` and one with
+ /// `FillPortion(3)`. The first will get 2 portions of the available space,
+ /// while the second one would get 3.
+ ///
+ /// `Length::Fill` is equivalent to `Length::FillPortion(1)`.
+ FillPortion(u16),
+
/// Fill the least amount of space
Shrink,
@@ -22,6 +31,7 @@ impl Length {
pub fn fill_factor(&self) -> u16 {
match self {
Length::Fill => 1,
+ Length::FillPortion(factor) => *factor,
Length::Shrink => 0,
Length::Units(_) => 0,
}