diff options
author | 2022-07-18 19:59:38 +0200 | |
---|---|---|
committer | 2022-07-18 19:59:38 +0200 | |
commit | 7e5a5ae743785c153fc328c8aa4ed290298ecc62 (patch) | |
tree | 2f69f59233cb3f71b75b76bb3ea0f2b3188cb8ef /native/src/widget/container.rs | |
parent | 61fd5b0050724a6b05f2b959c546a58cb6073de3 (diff) | |
download | iced-7e5a5ae743785c153fc328c8aa4ed290298ecc62.tar.gz iced-7e5a5ae743785c153fc328c8aa4ed290298ecc62.tar.bz2 iced-7e5a5ae743785c153fc328c8aa4ed290298ecc62.zip |
Fix `max_width` and `max_height` for `Container`
Diffstat (limited to 'native/src/widget/container.rs')
-rw-r--r-- | native/src/widget/container.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/native/src/widget/container.rs b/native/src/widget/container.rs index 493aa67b..3d68a595 100644 --- a/native/src/widget/container.rs +++ b/native/src/widget/container.rs @@ -127,12 +127,20 @@ pub fn layout<Renderer>( limits: &layout::Limits, width: Length, height: Length, + max_width: u32, + max_height: u32, padding: Padding, horizontal_alignment: alignment::Horizontal, vertical_alignment: alignment::Vertical, layout_content: impl FnOnce(&Renderer, &layout::Limits) -> layout::Node, ) -> layout::Node { - let limits = limits.loose().width(width).height(height).pad(padding); + let limits = limits + .loose() + .max_width(max_width) + .max_height(max_height) + .width(width) + .height(height) + .pad(padding); let mut content = layout_content(renderer, &limits.loose()); let size = limits.resolve(content.size()); @@ -171,6 +179,8 @@ where limits, self.width, self.height, + self.max_width, + self.max_height, self.padding, self.horizontal_alignment, self.vertical_alignment, |