mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 22:13:27 +02:00
restore terminal, rework console
This commit is contained in:
@@ -411,6 +411,9 @@ void UILineEdit::onFocusChange(bool focused, Fw::FocusReason reason)
|
||||
|
||||
bool UILineEdit::onKeyPress(uchar keyCode, std::string keyText, int keyboardModifiers)
|
||||
{
|
||||
if(UIWidget::onKeyPress(keyCode, keyText, keyboardModifiers))
|
||||
return true;
|
||||
|
||||
if(keyCode == Fw::KeyDelete) // erase right character
|
||||
removeCharacter(true);
|
||||
else if(keyCode == Fw::KeyBackspace) // erase left character {
|
||||
@@ -433,8 +436,7 @@ bool UILineEdit::onKeyPress(uchar keyCode, std::string keyText, int keyboardModi
|
||||
} else if(!keyText.empty() && (keyboardModifiers == Fw::KeyboardNoModifier || keyboardModifiers == Fw::KeyboardShiftModifier))
|
||||
appendText(keyText);
|
||||
else
|
||||
return UIWidget::onKeyPress(keyCode, keyText, keyboardModifiers);
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -1116,8 +1116,12 @@ void UIWidget::onStyleApply(const std::string& styleName, const OTMLNodePtr& sty
|
||||
// anchors
|
||||
else if(boost::starts_with(node->tag(), "anchors.")) {
|
||||
UIWidgetPtr parent = getParent();
|
||||
if(!parent)
|
||||
throw OTMLException(node, "cannot create anchor, there is no parent widget!");
|
||||
if(!parent) {
|
||||
if(m_firstOnStyle)
|
||||
throw OTMLException(node, "cannot create anchor, there is no parent widget!");
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
UIAnchorLayoutPtr anchorLayout = parent->getLayout()->asUIAnchorLayout();
|
||||
if(!anchorLayout)
|
||||
@@ -1331,9 +1335,7 @@ void UIWidget::propagateOnMouseRelease(const Point& mousePos, Fw::MouseButton bu
|
||||
child->setPressed(false);
|
||||
}
|
||||
|
||||
// fire release events only when pressed
|
||||
if(isPressed())
|
||||
onMouseRelease(mousePos, button);
|
||||
onMouseRelease(mousePos, button);
|
||||
}
|
||||
|
||||
bool UIWidget::propagateOnMouseMove(const Point& mousePos, const Point& mouseMoved)
|
||||
|
Reference in New Issue
Block a user