fix some ui events
This commit is contained in:
parent
afc197f2dc
commit
80564b9dff
|
@ -14,8 +14,8 @@ function MessageBox.create(title, text, flags)
|
||||||
window.id = "messageBoxWindow"
|
window.id = "messageBoxWindow"
|
||||||
window.title = title
|
window.title = title
|
||||||
window:centerIn("parent")
|
window:centerIn("parent")
|
||||||
--window:setLocked(true)
|
|
||||||
rootWidget:addChild(window)
|
rootWidget:addChild(window)
|
||||||
|
window:lock()
|
||||||
|
|
||||||
-- create messagebox label
|
-- create messagebox label
|
||||||
local label = UILabel.create()
|
local label = UILabel.create()
|
||||||
|
|
|
@ -364,6 +364,9 @@ void UILineEdit::onKeyPress(UIKeyEvent& event)
|
||||||
event.ignore();
|
event.ignore();
|
||||||
} else
|
} else
|
||||||
event.ignore();
|
event.ignore();
|
||||||
|
|
||||||
|
if(!event.isAccepted())
|
||||||
|
UIWidget::onKeyPress(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UILineEdit::onMousePress(UIMouseEvent& event)
|
void UILineEdit::onMousePress(UIMouseEvent& event)
|
||||||
|
|
|
@ -687,8 +687,6 @@ void UIWidget::onKeyPress(UIKeyEvent& event)
|
||||||
|
|
||||||
if(event.isAccepted())
|
if(event.isAccepted())
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
child->UIWidget::onKeyPress(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -712,8 +710,6 @@ void UIWidget::onKeyRelease(UIKeyEvent& event)
|
||||||
|
|
||||||
if(event.isAccepted())
|
if(event.isAccepted())
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
child->UIWidget::onKeyRelease(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,8 +737,6 @@ void UIWidget::onMousePress(UIMouseEvent& event)
|
||||||
|
|
||||||
if(event.isAccepted())
|
if(event.isAccepted())
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
child->UIWidget::onMousePress(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -764,8 +758,6 @@ void UIWidget::onMouseRelease(UIMouseEvent& event)
|
||||||
|
|
||||||
if(event.isAccepted())
|
if(event.isAccepted())
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
child->UIWidget::onMouseRelease(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -798,8 +790,6 @@ void UIWidget::onMouseMove(UIMouseEvent& event)
|
||||||
|
|
||||||
if(event.isAccepted())
|
if(event.isAccepted())
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
child->UIWidget::onMouseMove(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,7 +813,5 @@ void UIWidget::onMouseWheel(UIMouseEvent& event)
|
||||||
|
|
||||||
if(event.isAccepted())
|
if(event.isAccepted())
|
||||||
break;
|
break;
|
||||||
else
|
|
||||||
child->UIWidget::onMouseWheel(event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ void UIWindow::onMousePress(UIMouseEvent& event)
|
||||||
m_moving = true;
|
m_moving = true;
|
||||||
m_movingReference = event.pos() - getGeometry().topLeft();
|
m_movingReference = event.pos() - getGeometry().topLeft();
|
||||||
} else
|
} else
|
||||||
event.ignore();
|
UIWidget::onMousePress(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIWindow::onMouseRelease(UIMouseEvent& event)
|
void UIWindow::onMouseRelease(UIMouseEvent& event)
|
||||||
|
@ -105,7 +105,7 @@ void UIWindow::onMouseRelease(UIMouseEvent& event)
|
||||||
if(m_moving)
|
if(m_moving)
|
||||||
m_moving = false;
|
m_moving = false;
|
||||||
else
|
else
|
||||||
event.ignore();
|
UIWidget::onMouseRelease(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIWindow::onMouseMove(UIMouseEvent& event)
|
void UIWindow::onMouseMove(UIMouseEvent& event)
|
||||||
|
@ -113,5 +113,5 @@ void UIWindow::onMouseMove(UIMouseEvent& event)
|
||||||
if(m_moving)
|
if(m_moving)
|
||||||
move(event.pos() - m_movingReference);
|
move(event.pos() - m_movingReference);
|
||||||
else
|
else
|
||||||
event.ignore();
|
UIWidget::onMouseMove(event);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue