mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-27 01:29:58 +01:00
[escher] In textfields, in editing mode, OK == EXE
Change-Id: I83c9fd8f6c5ea5348067108899a065a3b1d69d5c
This commit is contained in:
@@ -45,7 +45,7 @@ bool TextFieldDelegateApp::cursorInToken(TextField * textField, const char * tok
|
||||
}
|
||||
|
||||
bool TextFieldDelegateApp::textFieldDidReceiveEvent(TextField * textField, Ion::Events::Event event) {
|
||||
if (event == Ion::Events::OK && textField->isEditing()) {
|
||||
if ((event == Ion::Events::OK || event == Ion::Events::EXE) && textField->isEditing()) {
|
||||
Expression * exp = Expression::parse(textField->text());
|
||||
if (exp == nullptr) {
|
||||
if (textField->textLength() == 0) {
|
||||
|
||||
@@ -269,7 +269,7 @@ bool TextField::handleEvent(Ion::Events::Event event) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (event == Ion::Events::OK) {
|
||||
if (event == Ion::Events::OK || event == Ion::Events::EXE) {
|
||||
if (isEditing()) {
|
||||
strlcpy(m_contentView.textBuffer(), m_contentView.draftTextBuffer(), m_contentView.bufferSize());
|
||||
setEditing(false);
|
||||
@@ -277,6 +277,9 @@ bool TextField::handleEvent(Ion::Events::Event event) {
|
||||
reloadScroll();
|
||||
return true;
|
||||
}
|
||||
if (event == Ion::Events::EXE) {
|
||||
return false;
|
||||
}
|
||||
setEditing(true);
|
||||
insertTextAtLocation(m_contentView.textBuffer(), cursorLocation());
|
||||
setCursorLocation(strlen(m_contentView.draftTextBuffer()));
|
||||
|
||||
Reference in New Issue
Block a user