From b05f7eb915a86f67249904061d70f293066de618 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 25 Oct 2023 21:23:30 +0400 Subject: [PATCH] Resize widgets after adding to VerticalLayout. --- ui/wrap/vertical_layout.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/wrap/vertical_layout.cpp b/ui/wrap/vertical_layout.cpp index 4ebdeb9..88991ce 100644 --- a/ui/wrap/vertical_layout.cpp +++ b/ui/wrap/vertical_layout.cpp @@ -126,6 +126,10 @@ RpWidget *VerticalLayout::insertChild( _rows.insert( begin(_rows) + atPosition, { std::move(child), margin }); + auto availRowWidth = widthNoMargins() + - margin.left() + - margin.right(); + weak->resizeToNaturalWidth(availRowWidth); weak->heightValue( ) | rpl::start_with_next_done([=] { if (!_inResize) {