Realign all parent boxes when autosizedwidgets change size

This commit is contained in:
MiroslavR 2014-09-01 03:38:05 +02:00
parent ccca6db865
commit 41c6045986

View file

@ -544,12 +544,8 @@ namespace MWGui
void AutoSizedWidget::notifySizeChange (MyGUI::Widget* w) void AutoSizedWidget::notifySizeChange (MyGUI::Widget* w)
{ {
if (w->getParent () != 0) MyGUI::Widget * parent = w->getParent();
{ if (parent != 0)
Box* b = dynamic_cast<Box*>(w->getParent());
if (b)
b->notifyChildrenSizeChanged ();
else
{ {
if (mExpandDirection == MyGUI::Align::Left) if (mExpandDirection == MyGUI::Align::Left)
{ {
@ -557,6 +553,13 @@ namespace MWGui
w->setPosition(w->getPosition() - MyGUI::IntPoint(hdiff, 0)); w->setPosition(w->getPosition() - MyGUI::IntPoint(hdiff, 0));
} }
w->setSize(getRequestedSize ()); w->setSize(getRequestedSize ());
while (parent != 0)
{
Box * b = dynamic_cast<Box*>(parent);
if (b)
b->notifyChildrenSizeChanged();
parent = parent->getParent();
} }
} }
} }