summaryrefslogtreecommitdiffstats
path: root/core/src/length.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2019-11-24 11:34:30 +0100
committerLibravatar GitHub <noreply@github.com>2019-11-24 11:34:30 +0100
commit149fd2aa1fa86858c7c1dcec8fd844caa78cec94 (patch)
treea199cf8d2caaf6aa60e48e93d6dd0688969d43b0 /core/src/length.rs
parent9712b319bb7a32848001b96bd84977430f14b623 (diff)
parent47196c9007d12d3b3e0036ffabe3bf6d14ff4523 (diff)
downloadiced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.gz
iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.tar.bz2
iced-149fd2aa1fa86858c7c1dcec8fd844caa78cec94.zip
Merge pull request #65 from hecrj/improvement/docs
Documentation
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,