implement move policy for window moving

This commit is contained in:
Eduardo Bart
2011-11-03 10:48:48 -02:00
parent 14ce1c8183
commit 9636392d58
4 changed files with 29 additions and 8 deletions

View File

@@ -32,6 +32,13 @@ void UIVerticalLayout::update()
{
UIWidgetPtr parentWidget = getParentWidget();
UIWidgetList widgets = parentWidget->getChildren();
// sort by Y center
std::sort(widgets.begin(), widgets.end(),
[](const UIWidgetPtr& first, const UIWidgetPtr& second) -> bool {
return first->getRect().center().y < second->getRect().center().y;
});
Point pos = parentWidget->getPosition();
for(const UIWidgetPtr& widget : widgets) {
Size size = widget->getSize();