From 0655a20ad119e2e9790afcc45039fd4ac0e7d432 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 16 Mar 2023 20:23:25 +0100 Subject: Make `Shrink` have priority over `Fill` in layout --- widget/src/pick_list.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'widget/src/pick_list.rs') diff --git a/widget/src/pick_list.rs b/widget/src/pick_list.rs index 022ca8d9..13110725 100644 --- a/widget/src/pick_list.rs +++ b/widget/src/pick_list.rs @@ -393,7 +393,7 @@ where { use std::f32; - let limits = limits.width(width).height(Length::Shrink).pad(padding); + let limits = limits.width(width).height(Length::Shrink); let font = font.unwrap_or_else(|| renderer.default_font()); let text_size = text_size.unwrap_or_else(|| renderer.default_size()); @@ -451,7 +451,10 @@ where f32::from(text_line_height.to_absolute(text_size)), ); - limits.resolve(intrinsic).pad(padding) + limits + .shrink(padding) + .resolve(intrinsic, width, Length::Shrink) + .expand(padding) }; layout::Node::new(size) -- cgit