From 59888677876e4cc232310c946bbe3ae3606d5aae Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Thu, 3 Nov 2011 14:27:13 -0200 Subject: [PATCH] fix vertical sort --- src/framework/ui/uiverticallayout.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/framework/ui/uiverticallayout.cpp b/src/framework/ui/uiverticallayout.cpp index c17b8eae..0e1963f7 100644 --- a/src/framework/ui/uiverticallayout.cpp +++ b/src/framework/ui/uiverticallayout.cpp @@ -33,7 +33,7 @@ void UIVerticalLayout::update() UIWidgetPtr parentWidget = getParentWidget(); UIWidgetList widgets = parentWidget->getChildren(); - // sort by Y center + // sort by Y pos std::sort(widgets.begin(), widgets.end(), [](const UIWidgetPtr& first, const UIWidgetPtr& second) -> bool { return first->getY() < second->getY(); @@ -57,6 +57,8 @@ void UIVerticalLayout::update() void UIVerticalLayout::addWidget(const UIWidgetPtr& widget) { + // needed to be correcly sorted on update + widget->setY(9999); update(); }