summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-09 01:37:57 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-09 01:37:57 +0100
commita4e833e860c41796d491ab43e84239fcca1f303d (patch)
treec41ab304ffaf2dc2311c7d33916cd0515114ad31 /core
parent2ff0e48142c302cb93130164d083589bb2ac4979 (diff)
parentcc529a1803972604b122c19c0104e71532fff993 (diff)
downloadiced-a4e833e860c41796d491ab43e84239fcca1f303d.tar.gz
iced-a4e833e860c41796d491ab43e84239fcca1f303d.tar.bz2
iced-a4e833e860c41796d491ab43e84239fcca1f303d.zip
Merge branch 'master' into feature/shrink-by-default
Diffstat (limited to 'core')
-rw-r--r--core/src/background.rs2
-rw-r--r--core/src/length.rs10
2 files changed, 11 insertions, 1 deletions
diff --git a/core/src/background.rs b/core/src/background.rs
index 2f75e45c..e1a37ddc 100644
--- a/core/src/background.rs
+++ b/core/src/background.rs
@@ -12,4 +12,4 @@ impl From<Color> for Background {
fn from(color: Color) -> Self {
Background::Color(color)
}
-} \ No newline at end of file
+}
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,
}