improv miniwindow move

This commit is contained in:
Eduardo Bart 2011-11-03 11:19:12 -02:00
parent 9636392d58
commit 4b8a0bab77
3 changed files with 3 additions and 4 deletions

View File

@ -23,7 +23,6 @@ MiniWindow < UIWindow
margin.left: 6 margin.left: 6
margin.right: 6 margin.right: 6
move policy: free updated move policy: free updated
focusable: false
border-image: border-image:
source: /core_styles/images/mini_window.png source: /core_styles/images/mini_window.png
border: 4 border: 4

View File

@ -36,7 +36,7 @@ void UIVerticalLayout::update()
// sort by Y center // sort by Y center
std::sort(widgets.begin(), widgets.end(), std::sort(widgets.begin(), widgets.end(),
[](const UIWidgetPtr& first, const UIWidgetPtr& second) -> bool { [](const UIWidgetPtr& first, const UIWidgetPtr& second) -> bool {
return first->getRect().center().y < second->getRect().center().y; return first->getY() < second->getY();
}); });
Point pos = parentWidget->getPosition(); Point pos = parentWidget->getPosition();

View File

@ -135,6 +135,8 @@ bool UIWindow::onMouseRelease(const Point& mousePos, Fw::MouseButton button)
{ {
if(m_moving) { if(m_moving) {
m_moving = false; m_moving = false;
if(m_movePolicy == FREE_UPDATED_MOVE)
updateParentLayout();
return true; return true;
} }
return UIWidget::onMouseRelease(mousePos, button); return UIWidget::onMouseRelease(mousePos, button);
@ -144,8 +146,6 @@ bool UIWindow::onMouseMove(const Point& mousePos, const Point& mouseMoved)
{ {
if(m_moving) { if(m_moving) {
moveTo(mousePos - m_movingReference); moveTo(mousePos - m_movingReference);
if(m_movePolicy == FREE_UPDATED_MOVE)
updateParentLayout();
return true; return true;
} }
return UIWidget::onMouseMove(mousePos, mouseMoved); return UIWidget::onMouseMove(mousePos, mouseMoved);