Léa Saviot
a56a73b0ba
[apps/calculation] Fix calculation height computation
...
It was done in two places before, which created inconsistencies
2020-05-28 04:44:27 -07:00
Léa Saviot
5535145b51
[apps/calculation] Calculation on 2 lines if does not fit when expanded
...
Scenario: 1+1+1+1+1+1+1+10.5 fits on one line when not expanded, but
when the exact result is displayed not -> we thus always display it on
two lines
2020-05-28 04:44:27 -07:00
Léa Saviot
feee0a673c
[apps/calculation] HistoryViewCell cleaning
2020-05-28 04:44:27 -07:00
Léa Saviot
6948011ae0
[apps/calculation] Handle navigation in single lined output
2020-05-28 04:44:27 -07:00
Léa Saviot
579485c8c0
[apps/calculation] CanBeSingleLine differs if args are view/layout sizes
...
If the sizes are for layouts, we need to add the margins added by the
views.
2020-05-28 04:44:27 -07:00
Léa Saviot
11c39b6206
[apps/calculation] Calculation::height has two types of margin arguments
...
One for the margin between layouts and on top / at the bottom of the
cell, the other for the margin surrounding each layout.
2020-05-28 04:44:27 -07:00
Léa Saviot
78cac6ddae
[apps/calculation] Calculation::height has CanBeSingleLine argument
2020-05-28 04:44:27 -07:00
Léa Saviot
1c2801907f
[apps/calculation] Factorize and clean code
2020-05-28 04:44:27 -07:00
0b101
b48d3d6e4a
Added a new compact result display mode
2020-05-28 04:44:27 -07:00
Romain Goyet
950862f8d0
Use std::min and std::max
2020-04-14 09:31:02 -04:00
Émilie Feral
300de8fb15
[apps/calculation] HistoryViewCell: when changing SubviewType, set the
...
right subcell as first responder!
This fixes the following bug: when selecting a cell whose content is too
long to be displayed, the scrolling is broken
2020-04-03 10:42:42 +02:00
É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