From 40fa9b4de3f719ad11ceb665a724712ccbcb7376 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Thu, 23 Jun 2016 12:52:38 +0600 Subject: GUI: Fix ScrollContainerWidget's reflowLayout() --- gui/widgets/scrollcontainer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp index b975c42112..fdb02f8be2 100644 --- a/gui/widgets/scrollcontainer.cpp +++ b/gui/widgets/scrollcontainer.cpp @@ -111,8 +111,19 @@ void ScrollContainerWidget::handleCommand(CommandSender *sender, uint32 cmd, uin void ScrollContainerWidget::reflowLayout() { Widget::reflowLayout(); - recalc(); + + //reflow layout of inner widgets Widget *ptr = _firstWidget; + while (ptr) { + ptr->reflowLayout(); + ptr = ptr->next(); + } + + //recalculate height + recalc(); + + //hide those widgets which are out of visible area + ptr = _firstWidget; while (ptr) { int y = ptr->getAbsY() - getChildY(); int h = ptr->getHeight(); -- cgit v1.2.3