[apps/calculation] Do not reload if the ELView is already maximal

Change-Id: Id21cc71de7d5d83a30c6b7beea3c71108bed7197
This commit is contained in:
Léa Saviot
2018-04-25 18:08:35 +02:00
parent cff95c2ac1
commit ce81481922
2 changed files with 10 additions and 1 deletions

View File

@@ -110,7 +110,15 @@ bool EditExpressionController::expressionLayoutFieldDidAbortEditing(::Expression
}
void EditExpressionController::expressionLayoutFieldDidChangeSize(::ExpressionLayoutField * expressionLayoutField) {
reloadView();
/* Reload the view only if the ExpressionField height actually changes, i.e.
* not if the height is already maximal and stays maximal. */
if (view()) {
bool newInputViewHeightIsMaximal = static_cast<ContentView *>(view())->expressionField()->heightIsMaximal();
if (!m_inputViewHeightIsMaximal || !newInputViewHeightIsMaximal) {
m_inputViewHeightIsMaximal = newInputViewHeightIsMaximal;
reloadView();
}
}
}
TextFieldDelegateApp * EditExpressionController::textFieldDelegateApp() {