From e1438774af809c2951c4c7446638500446c81111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Sat, 14 Mar 2020 23:25:19 +0100 Subject: [PATCH] Fix `Scrollable` width consistency --- examples/styling/src/main.rs | 1 + native/src/widget/scrollable.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/styling/src/main.rs b/examples/styling/src/main.rs index 47408624a6..d6f41b04e7 100644 --- a/examples/styling/src/main.rs +++ b/examples/styling/src/main.rs @@ -93,6 +93,7 @@ impl Sandbox for Styling { ProgressBar::new(0.0..=100.0, self.slider_value).style(self.theme); let scrollable = Scrollable::new(&mut self.scroll) + .width(Length::Fill) .height(Length::Units(100)) .style(self.theme) .push(Text::new("Scroll me!")) diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index e83f25af9b..ec9746d4ae 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -118,7 +118,7 @@ where Renderer: 'static + self::Renderer + column::Renderer, { fn width(&self) -> Length { - Length::Fill + Widget::::width(&self.content) } fn height(&self) -> Length { @@ -132,7 +132,7 @@ where ) -> layout::Node { let limits = limits .max_height(self.max_height) - .width(Length::Fill) + .width(Widget::::width(&self.content)) .height(self.height); let child_limits = layout::Limits::new(