[apps/calculation] Reload display output when HistoryController appears

(to avoid displaying 2 = 2 when leaving and reentering Calculation app)
This commit is contained in:
Émilie Feral
2019-11-21 13:34:18 +01:00
committed by Léa Saviot
parent ec0c7c0384
commit 47e4abee81
4 changed files with 10 additions and 0 deletions

View File

@@ -58,6 +58,10 @@ void EditExpressionController::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(m_contentView.expressionField());
}
void EditExpressionController::viewWillAppear() {
m_historyController->viewWillAppear();
}
bool EditExpressionController::textFieldDidReceiveEvent(::TextField * textField, Ion::Events::Event event) {
bool shouldDuplicateLastCalculation = textField->isEditing() && textField->shouldFinishEditing(event) && textField->draftTextLength() == 0;
if (inputViewDidReceiveEvent(event, shouldDuplicateLastCalculation)) {