[apps] Probability: textfields should finish editing when the cursor is

on one edge of the field
This commit is contained in:
Émilie Feral
2017-12-20 16:20:29 +01:00
committed by EmilieNumworks
parent 077a95197e
commit 2c85fe88a5

View File

@@ -212,7 +212,9 @@ bool CalculationController::handleEvent(Ion::Events::Event event) {
}
bool CalculationController::textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) {
return (event == Ion::Events::Right && m_highlightedSubviewIndex < m_calculation->numberOfEditableParameters()) || event == Ion::Events::Left || TextFieldDelegate::textFieldShouldFinishEditing(textField, event);
return TextFieldDelegate::textFieldShouldFinishEditing(textField, event)
|| (event == Ion::Events::Right && textField->cursorLocation() == textField->draftTextLength() && m_highlightedSubviewIndex < m_calculation->numberOfEditableParameters())
|| (event == Ion::Events::Left && textField->cursorLocation() == 0);
}
bool CalculationController::textFieldDidFinishEditing(TextField * textField, const char * text, Ion::Events::Event event) {