summaryrefslogtreecommitdiffstats
path: root/native/src/widget/scrollable.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-07-19 18:34:39 +0200
committerLibravatar GitHub <noreply@github.com>2022-07-19 18:34:39 +0200
commit785385d889f02fc3805920b42ed8195a7f6a5672 (patch)
treef6e46210caf1ee9409f11cd97cad97b642d63bb3 /native/src/widget/scrollable.rs
parent61fd5b0050724a6b05f2b959c546a58cb6073de3 (diff)
parentcdd3802e6858c81985849aca9d2daf733828ba29 (diff)
downloadiced-785385d889f02fc3805920b42ed8195a7f6a5672.tar.gz
iced-785385d889f02fc3805920b42ed8195a7f6a5672.tar.bz2
iced-785385d889f02fc3805920b42ed8195a7f6a5672.zip
Merge pull request #1390 from iced-rs/fix/container-layout
Fix `max_width` and `max_height` for `Container`
Diffstat (limited to 'native/src/widget/scrollable.rs')
-rw-r--r--native/src/widget/scrollable.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 1b255860..77ed2066 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -162,9 +162,10 @@ pub fn layout<Renderer>(
limits: &layout::Limits,
width: Length,
height: Length,
+ max_height: u32,
layout_content: impl FnOnce(&Renderer, &layout::Limits) -> layout::Node,
) -> layout::Node {
- let limits = limits.width(width).height(height);
+ let limits = limits.max_height(max_height).width(width).height(height);
let child_limits = layout::Limits::new(
Size::new(limits.min().width, 0.0),
@@ -648,6 +649,7 @@ where
limits,
Widget::<Message, Renderer>::width(self),
self.height,
+ self.max_height,
|renderer, limits| self.content.layout(renderer, limits),
)
}