diff options
author | 2024-02-15 02:57:52 +0100 | |
---|---|---|
committer | 2024-02-15 02:57:52 +0100 | |
commit | 84cc9f130b4e29219d47db42cdb76548b054c66b (patch) | |
tree | 5758716b7ca1a35e589969efd9537f5e56dd1e27 /widget/src/space.rs | |
parent | 5827023ccc3f80012b17dbfe778fbd8b63186c99 (diff) | |
parent | 777e2e34f50c440f59d9a407f75be80fbbfaccae (diff) | |
download | iced-84cc9f130b4e29219d47db42cdb76548b054c66b.tar.gz iced-84cc9f130b4e29219d47db42cdb76548b054c66b.tar.bz2 iced-84cc9f130b4e29219d47db42cdb76548b054c66b.zip |
Merge pull request #2253 from iced-rs/improve-ergonomics
Improve some widget ergonomics
Diffstat (limited to 'widget/src/space.rs')
-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 |