diff options
author | 2024-02-15 02:08:22 +0100 | |
---|---|---|
committer | 2024-02-15 02:08:22 +0100 | |
commit | e8049af23dbf4988ff24b75b90104295f61098a2 (patch) | |
tree | 21840d4799c0645d9572af6d44c58bd7be117a39 /widget/src/space.rs | |
parent | 9dd20ead085ff3b9b4bd441b5e4938cf8e813f35 (diff) | |
download | iced-e8049af23dbf4988ff24b75b90104295f61098a2.tar.gz iced-e8049af23dbf4988ff24b75b90104295f61098a2.tar.bz2 iced-e8049af23dbf4988ff24b75b90104295f61098a2.zip |
Make `horizontal_space` and `vertical_space` fill by default
Diffstat (limited to '')
-rw-r--r-- | widget/src/space.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/widget/src/space.rs b/widget/src/space.rs index aeec91f9..35bb30c4 100644 --- a/widget/src/space.rs +++ b/widget/src/space.rs @@ -39,6 +39,18 @@ impl Space { height: height.into(), } } + + /// Sets the width of the [`Space`]. + pub fn width(mut self, width: impl Into<Length>) -> Self { + self.width = width.into(); + self + } + + /// Sets the height of the [`Space`]. + pub fn height(mut self, height: impl Into<Length>) -> Self { + self.height = height.into(); + self + } } impl<Message, Theme, Renderer> Widget<Message, Theme, Renderer> for Space |