[apps/escher] Force expressionField relayout when size changed

Scenario: in Calculations and in Graph, edit the layout field by adding
many parentheses. When the layout field has maximal height but the
parentheses are bigger than it, ther is a margin that appears at the
bottom, because we did not relayout the layout field to optimize
redrawing. We need to force the relayout, otherwise as the layout field
stays we the same frame, the relayouting is not properly done.
This commit is contained in:
Léa Saviot
2019-10-02 11:48:03 +02:00
parent 9f018eb9d9
commit 0630ae55c7
2 changed files with 14 additions and 0 deletions

View File

@@ -98,6 +98,13 @@ void EditExpressionController::layoutFieldDidChangeSize(::LayoutField * layoutFi
if (!m_inputViewHeightIsMaximal || !newInputViewHeightIsMaximal) {
m_inputViewHeightIsMaximal = newInputViewHeightIsMaximal;
reloadView();
} else {
/* The input view is already at maximal size so we do not need to relayout
* the view underneath, but the view inside the input view might still need
* to be relayouted.
* We force the relayout because the frame stays the same but we need to
* propagate a relayout to the content of the field scroll view. */
m_contentView.expressionField()->layoutSubviews(true);
}
}