Commit Graph

110 Commits

Author SHA1 Message Date
Émilie Feral
24d9f37205 [apps/calculation] Clean how cell subtype is selected/
This fixes crashes: indeed, in the way it was done before, we called
scrollToSubviewOfTypeOfCellAtLocation after setting the new selected subtype
and before reloading the data. However, selecting a new subtype might expand
the selected cell which can temper with the cell repartition. If so, we need to
reload the data to be able to call 'selectedCell' for instance.
2020-02-20 10:56:11 +01:00
Émilie Feral
2a03583fe0 [apps/calculation] Reset history cell memoization when reloading the
table. Otherwise, the Poincare pool store useless layouts for cells that
aren't displayed.

This fixes the following issue: input "(transpose([1 2 3 4 5 6][1 2 3 4 5
6])^8", the computation works, clear the history, input the same
calculation again, it fails with a memory error.
2020-02-19 10:34:28 +01:00
Émilie Feral
a82ff2b703 [apps/calculation] HistoryController: in historyViewCellDidChangeSelection,
limit the whole table reloading to cases where the cell height did
actually change to avoid useless blinking
2020-02-12 15:13:22 +01:00
Émilie Feral
71de56f87a [apps/calculation] HistoryViewCell: fix setHighlighted to reload
subviews highlight
2020-02-12 15:13:22 +01:00
Émilie Feral
b39b8da036 [apps/calculation] HistoryViewCell: prevent from selecting ellipsis
suview if it not visible
2020-02-12 15:13:22 +01:00
Émilie Feral
a39ca58470 [apps/calculation] HistoryViewCell: fix first responder. The first
responder is the HistoryViewCell when the ellipsis subview is selected
2020-02-12 15:13:22 +01:00
Émilie Feral
767d1654cc [apps/calculation] HistoryViewCell: select the right expression of
output when coming from ellipsis subview
2020-02-12 15:13:22 +01:00
Émilie Feral
39dbb7d68c [apps/calculation] Fix relayouting when highlighted cell changed
This fixes the following scenario: add "1.2" 5 times, go up three times,
and down three times, the last cell was not correctly relayout.
2020-02-12 15:13:22 +01:00
Émilie Feral
7d0a1cd0b2 [apps/calculation] HistoryViewCell: enable selecting the ellipsis 2020-02-12 15:13:22 +01:00
Émilie Feral
9a97fc01b2 [apps/calculation] HistoryViewCell: m_expandedCalculation memoizes true
only when the calculation is actually expanded (when the output is
selected and the display output is ExactApproximateToggle)

This avoid blinking when changing input/output selection
2020-02-12 15:13:22 +01:00
Émilie Feral
f276a88e79 [apps/calculation] HistoryViewCell: display ellipsis view when
highlighted
2020-02-12 15:13:22 +01:00
Émilie Feral
251db5b60e [apps/shared][apps/calculation] Change class names:
ScrollableInputExactApproximateExpressionsCell -->
ScrollableThreeExpressionsCell
AbstractScrollableExactApproximateExpressionsView -->
AbstractScrollableMultipleExpressionsView
ScrollableExactApproximateExpressionsView -->
ScrollableTwoExpressionsView
ScrollableInputExactApproximateExpressionsView -->
ScrollableTwoExpressionsCell
2020-02-12 15:13:22 +01:00
Émilie Feral
56319ef275 [apps/shared] AbstractScrollableExactApproximateExpressionsView can hold up to
three expressions but no more BurgerMenuView.
ScrollableExactApproximateExpressionsView and
ScrollableInputExactApproximateExpressionsView inherit from it.
2020-02-12 15:13:22 +01:00
Émilie Feral
398b529811 [apps/calculation][poincare] AdditionalInformationType is determined
from both input and output expressions of a Calculation
2020-02-12 15:13:21 +01:00
Léa Saviot
97c5ef79af [apps/calc] Display ApproximateOnly if approximate layout cannot be created 2020-02-12 15:13:21 +01:00
Léa Saviot
1af28d4310 [apps/calc] Display ApproximateOnly if exact layout cannot be created 2020-02-12 15:13:21 +01:00
Émilie Feral
90957d137a [apps/calculation] HistoryViewCell: avoid blinking 2020-02-12 15:13:20 +01:00
Émilie Feral
f52f25e491 [calculation] HistoryViewCell: add TODO 2020-02-12 15:13:20 +01:00
Émilie Feral
73a8ec24f2 [calculation] Revert "HistoryViewCell: remove useless m_expandedCalculation"
When scrolling up and down, only 'setCalculation' is called by
'willDisplayCellForIndex' - and not 'cellDidSelectSubview'. So a new cell
should be informed of the expanded state in 'setCalculation'.
2020-02-12 15:13:20 +01:00
Émilie Feral
c47394ae22 [calculation] (revert previous commit) HistoryViewCell: setCalculation
should decide which subviews is displayed.
'setCalculation' is the only method called when scrolling (when using
a new cell for a calculation) so it should take into accound whether the
cell is expanded or not.

This fixes the bug: when pushing several calculations (which expand) in
the store, scrolling up and down corrupts the cells contents
2020-02-12 15:13:20 +01:00
Émilie Feral
9312d2bd65 [escher] ExpressionTableCell is composed of a ScrollableExpressionView
instead of an ExpressionView
2020-02-12 15:13:19 +01:00
Émilie Feral
6ed9e11de3 [apps/shared] ScrollableExactApproximateExpressionsView: split
ScrollableExactApproximateExpressionsView into
AbstractScrollableExactApproximateExpressionsView and
ScrollableExactApproximateExpressionsView to factorize code with future
ScrollableInputExactApproximateExpressionsView
2020-02-12 15:13:18 +01:00
Émilie Feral
a21689d72c [apps/calculation][poincare] Move additionalInformationType method from
Calculation to Poincare module
2020-02-12 15:13:18 +01:00
Émilie Feral
e932e8f895 [apps/calculation] Fix HistoryController: update the OutputView when
reloading the table data
2020-02-12 15:13:18 +01:00
Émilie Feral
400819d87d [apps/calculation] HistoryViewCell: remove useless m_expandedCalculation 2020-02-12 15:13:18 +01:00
Émilie Feral
6c9832c9e1 [apps/calculation] Avoid blinking in Calculation 2020-02-12 15:13:18 +01:00
Émilie Feral
efe66a1218 [apps/calculation] HistoryViewCell: memoize the calculation additional
output and display burger when required
2020-02-12 15:13:18 +01:00
Léa Saviot
9f018eb9d9 [escher/view] setFrame and layoutSubviews can be forced 2020-02-12 15:13:15 +01:00
Émilie Feral
f3c6aab669 [apps/calculation] HistoryViewCell: when reloading the entire table due
to a cell selection, the cell used for the selected row might change. We
thereby have to update the selected cell once the table has been
reloaded.

This fixes the following bug: add 5 times the calculation "12.2". Go up,
the selected expression is the left one instead of the right one.
2020-01-06 14:07:20 +01:00
Léa Saviot
23acdd7f0d [apps/calc] Simplify the HistoryViewCell::m_calculationCRC32 initialization
It is not very probable that a new CRC32 should be computed to 0, and
maybe not less probable than being computed to the CRC32 of an empty
computation. However this was not mathematially verified.
2019-08-08 17:22:03 +02:00
Léa Saviot
9c95018034 [apps/calc] Init HistoryViewCell::m_calculationCRC32 to better value 2019-08-08 17:22:03 +02:00
Léa Saviot
b4f6e37399 [apps/calcualtion] Optimize pool use 2019-08-08 17:22:03 +02:00
Léa Saviot
05678b48f6 [apps/calc] Remove whole calculation memoization in HistoryViewCell
It is no longer compatible with the new calculations as they no longer
have a constant size.
2019-08-08 17:22:03 +02:00
Ruben Dashyan
eb6d697927 [apps] Make app accessors static members of App classes 2019-07-19 15:06:25 +02:00
Ruben Dashyan
44809f4b3f Substitute Escher app() by Container::activeApp() 2019-07-19 15:06:25 +02:00
Romain Goyet
21907fb89a [apps] Get rid of App casts 2019-07-19 15:06:25 +02:00
Émilie Feral
a48bec14d2 [calculation] Fix scroll on calculation heigher than the screen.
Changing the selectedSubviewType reloads the selection on the cell so we
need to scrollToSubviewOfTypeOfCellAtLocation afterwards.
2019-05-03 15:54:22 +02:00
Émilie Feral
3168ec14c3 [calculation] HistoryViewCell: fix layoutSubviews to fix weird scrolling
When successively adding calculations 0.2 and int(x*exp(-4x), 0,99) the
reloadScroll would fail
2019-05-03 15:54:22 +02:00
Émilie Feral
1e72a1c9c2 [calculation] HistoryViewCell: clean 2019-05-03 15:54:21 +02:00
Émilie Feral
a30191ccb4 [calculation] Change name: 'calculation selected' --> 'calculation
expanded'
2019-05-03 15:54:21 +02:00
Émilie Feral
12876b177f [calculation] Calculation: discard Calculation::toggleDisplayExact (this
feature will be developed later)
2019-05-03 15:54:21 +02:00
Émilie Feral
3f961b7705 [calculation] HistoryViewCell: better split reload (highlight, scroll
etc)  between willDisplayCellForIndex and cellDidSelectSubview
2019-05-03 15:54:21 +02:00
Émilie Feral
05a235803f [calculation] HistoryViewCell: fix scroll reloading and right or left
outputs selection (the order of events here matters)
2019-05-03 15:54:21 +02:00
Émilie Feral
39c53b5e8b [calculation] HistoryViewCell: memoize calculation and cell selection to
speed up navigation in HistoryController
2019-05-03 15:54:21 +02:00
Émilie Feral
8e0d3065f7 [calculation] HistoryViewCell: reloadCell selects the right or left
output according to the calculation hold (this enables to discard
unnecessary reloadScroll)
2019-05-03 15:54:21 +02:00
Émilie Feral
06a8382ff4 [shared] ScrollableExactApproximateExpressionsView: change the selected
output only when one of the two layout is uninitialized. Otherwise, the
parent cell decides of which of right or left output should be selected.
2019-05-03 15:54:21 +02:00
Émilie Feral
80078137d5 [calculation] Display exact and approximate outputs in the
calculation history when the output is selected for calculations
involving decimal numbers (1.2)
2019-05-03 15:54:20 +02:00
Ruben Dashyan
1081127c97 [apps/calculation] Simplify HistoryViewCell::handleEvent 2019-05-03 15:54:20 +02:00
Ruben Dashyan
2d7c87d461 [apps/calculation] HistoryViewCell does not need to hold layouts 2019-05-03 15:54:20 +02:00
Léa Saviot
6f7fe5089a [apps/calculation] Calculation::DisplayOutput can be Exact/Approx/Both 2019-05-03 15:53:21 +02:00