ExpressionFieldDelegateApp::layoutFieldDidReceiveEvent
Layouts have two potential serializations. For example,
HorizontalLayout(CharLayout(2), CharLayout(a)) can be serialized as:
"2a" and "2*a". In layoutFieldDidReceiveEvent, we want to check that the
longest serialisation is bounded by maxBufferSize. (We could have used
Layout::serializeParsedExpression but we don't to avoid parsing the
expression twice)
Remove all margins from those cells.
Rather add margins to their respective subviews:
- ScrollableExpressionView
- ScrollableExactApproximateExpressionsView.
As a notable consequence, the distance in HistoryViewCell between its
subviews becomes 10 instead of 5.
In passing, replace
- Metric::HistoryHorizontalMargin = 10
- ScrollableExactApproximateExpressionsView::k_digitHorizontalMargin = 10
- HistoryViewCell::k_digitVerticalMargin = 5
- ScrollableExactApproximateExpressionsCell::k_margin = 5
by
- Metric::CommonSmallMargin = 5
- Metric::CommonLargeMargin = 10.
In HistoryController::willDisplayCellForIndex, both setCalculation and
reloadCell end up calling ScrollableExpressionView::layoutSubviews.
Indeed, setCalculation calls setLayout over m_inputView, which in turn
calls layoutSubviews. It is logical to remove the first occurence.
"Expressions" was not German so far, I suggest "Ausdruecke"
The correct plural of function in German is "Funktionen".
"Namen" is a noun, and therefore written uppercase in German.
This fixes the following scenario: create a script that draws at
importation (for instance, add "squares()" at the end of squares.py) and
execute this script. The sandbox is displayed but events are handled by
the underneath text field, thus leading to the display of the variable
box and other bugs.
It called textFieldDidAbortEditing, which called setFirstResponder,
which could clash with another setFirstResponder higher in the call
tree.
Scenario: build with an update popup, create a new script, edit its name
with an unvalid name and press the Power key while editing. When
powering on the device again, the first responder is not the popup even
though it is displayed, and pressing OK does not dismiss it.