mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[escher] When textfield receive "^2" (square) event, the cursor should
position after the 2 Change-Id: I76c0cf4724f06e7af70a329701003bc32d61fde8
This commit is contained in:
@@ -333,7 +333,9 @@ bool TextField::handleEvent(Ion::Events::Event event) {
|
||||
setEditing(true);
|
||||
insertTextAtLocation(event.text(), cursorLocation());
|
||||
}
|
||||
int cursorDelta = strlen(event.text()) > 1 ? -1 : 0;
|
||||
/* All events whose text is longer than 2 have parenthesis. In these cases,
|
||||
* we want to position the cursor before the last parenthesis */
|
||||
int cursorDelta = strlen(event.text()) > 2 ? -1 : 0;
|
||||
setCursorLocation(cursorLocation() + strlen(event.text()) + cursorDelta);
|
||||
layoutSubviews();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user