summaryrefslogtreecommitdiffstats
path: root/core/src/length.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-18 07:16:19 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2019-11-18 07:16:19 +0100
commitd3553adf278e5b616fbd885f321faa83a4d24b56 (patch)
tree5bbfba3b45fd34d9c9604f28bcbb80e9856873a3 /core/src/length.rs
parent63dbf078fefea444073813e834c2d35fa25eb3a7 (diff)
downloadiced-d3553adf278e5b616fbd885f321faa83a4d24b56.tar.gz
iced-d3553adf278e5b616fbd885f321faa83a4d24b56.tar.bz2
iced-d3553adf278e5b616fbd885f321faa83a4d24b56.zip
Write documentation for `iced_core`
Diffstat (limited to 'core/src/length.rs')
-rw-r--r--core/src/length.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/length.rs b/core/src/length.rs
index 73c227d8..63ba6207 100644
--- a/core/src/length.rs
+++ b/core/src/length.rs
@@ -1,12 +1,24 @@
/// The strategy used to fill space in a specific dimension.
#[derive(Debug, Clone, Copy, PartialEq, Hash)]
pub enum Length {
+ /// Fill all the remaining space
Fill,
+
+ /// Fill the least amount of space
Shrink,
+
+ /// Fill a fixed amount of space
Units(u16),
}
impl Length {
+ /// Returns the _fill factor_ of the [`Length`].
+ ///
+ /// The _fill factor_ is a relative unit describing how much of the
+ /// remaining space should be filled when compared to other elements. It
+ /// is only meant to be used by layout engines.
+ ///
+ /// [`Length`]: enum.Length.html
pub fn fill_factor(&self) -> u16 {
match self {
Length::Fill => 1,