summaryrefslogtreecommitdiffstats
path: root/core/src/length.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-05 17:24:43 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-10 10:01:49 +0100
commit22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5 (patch)
tree22214a4ac6bca5033f6d5a227934288019f6ca60 /core/src/length.rs
parent0322e820eb40d36a7425246278b7bcb22b7010aa (diff)
downloadiced-22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5.tar.gz
iced-22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5.tar.bz2
iced-22226394f7b1a0e0205b9bb5b3ef9b85a3b406f5.zip
Introduce `Widget::size_hint` and fix further layout inconsistencies
Diffstat (limited to 'core/src/length.rs')
-rw-r--r--core/src/length.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/length.rs b/core/src/length.rs
index 3adb996e..6dc15049 100644
--- a/core/src/length.rs
+++ b/core/src/length.rs
@@ -36,6 +36,12 @@ impl Length {
Length::Fixed(_) => 0,
}
}
+
+ /// Returns `true` iff the [`Length`] is either [`Length::Fill`] or
+ // [`Length::FillPortion`].
+ pub fn is_fill(&self) -> bool {
+ self.fill_factor() != 0
+ }
}
impl From<Pixels> for Length {