improv miniwindow move
This commit is contained in:
parent
9636392d58
commit
4b8a0bab77
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue