aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-23 12:52:38 +0600
committerEugene Sandulenko2016-07-03 12:19:15 +0200
commit40fa9b4de3f719ad11ceb665a724712ccbcb7376 (patch)
tree4d4471d07de7e3370f8b5178a14350be0587989f
parentac25acbccc384eaf1a4e5169da1da3e475b97c83 (diff)
downloadscummvm-rg350-40fa9b4de3f719ad11ceb665a724712ccbcb7376.tar.gz
scummvm-rg350-40fa9b4de3f719ad11ceb665a724712ccbcb7376.tar.bz2
scummvm-rg350-40fa9b4de3f719ad11ceb665a724712ccbcb7376.zip
GUI: Fix ScrollContainerWidget's reflowLayout()
-rw-r--r--gui/widgets/scrollcontainer.cpp13
1 files changed, 12 insertions, 1 deletions
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,9 +111,20 @@ 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();
bool visible = true;