Commit Graph

81 Commits

Author SHA1 Message Date
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
Léa Saviot
496d346049 Remove max/min inline from KDCoordinate header 2019-05-03 15:53:19 +02:00
Ruben Dashyan
0943406263 Fix HistoryViewCell and ScrollableExactApproximateExxpressionsCell margins issue
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.
2019-02-18 16:49:58 +01:00
Ruben Dashyan
da0d42ca3b [apps/calculation/history_view_cell] Fix background colors
Set m_inputView's m_expressionView's background color
2019-02-18 16:49:58 +01:00
Ruben Dashyan
0e0b49acce [apps/calculation] Remove HistoryViewCell horizontal margins 2019-02-18 16:49:58 +01:00
Ruben Dashyan
8029aab060 [apps/calculation] Remove unecessary namespace 2019-02-18 16:49:58 +01:00
Émilie Feral
f7193602ef [calculation] Bug in the subview selected with heigh cells
In SelectableTableView::selectCellAtLocation, we call 'tableViewDidChangeSelection'
before scrolling. Therefore, the cell with updated with the right selected subview
is not the one drawn... To solve this issue, we keep the selectedSubview ('model')
 in the HistoryController instead of in the limited-lifespan view.
2018-12-06 14:52:23 +01:00
Léa Saviot
8e6cff9572 [apps] Remove faulty assertion 2018-11-23 12:04:03 +01:00
Léa Saviot
196e74297e [apps] Rename exact/approx as left/right in scrollable_exact_approx_exp_view 2018-11-23 12:04:03 +01:00
Léa Saviot
d083d05609 [apps/calculation] Display the exact layout only when the exp is Store 2018-11-23 12:04:03 +01:00
Léa Saviot
ed5a6d4a03 [apps/calculation] Remove unneeded arguments 2018-11-19 18:02:55 +01:00
Émilie Feral
4e8cd02d3f [calculation] Fix memoization: hold the calculation and not its address
which is likely to have changed
2018-09-21 18:16:21 +02:00
Léa Saviot
8b75802746 [calculation] Don't recompute HistoryViewCell layout if same calculation 2018-09-20 17:21:34 +02:00
Émilie Feral
365b145cf3 [poincare] Change names: LayoutReference-->Layout 2018-09-18 16:29:44 +02:00
Émilie Feral
616e4c0bcc [poincare] Change name: LayoutRef --> LayoutReference 2018-09-14 16:57:12 +02:00
Émilie Feral
33f7ca841c [shared] Change
ScrollableExactApproximateExpressionsView::setExpressions to setLayouts
2018-09-07 10:02:48 +02:00
Léa Saviot
71c807b565 [poincare] Node->isDefined becomes !Node->isUninitialized 2018-08-14 16:40:12 +02:00
Léa Saviot
5d9e69dedc [poincare] Remove Tree constructors that use nullptr as parameter 2018-08-14 14:58:47 +02:00
Léa Saviot
f579e95815 [poincare] Start removing ExpressionLayout 2018-07-03 17:33:06 +02:00
Émilie Feral
ac9da8d559 [escher] Handle copy/cut event on Expression in selectable table view 2018-06-07 14:46:14 +02:00
Émilie Feral
1f57d0a242 [solver] Fix an even odd bug: make colors consistent between even odd
cells and inheriting even odd cells
(scrollable_exact_approximate_expressions_cell)
2018-06-07 13:46:18 +02:00
Émilie Feral
cfb891d7bd [shared] Move OutputExpressionView & ScrollableOuputExpression view to shared/ with new name:
ScrollableExactApproximateExpressionsView (for future implementation of solver
solution page)
2018-06-07 13:46:18 +02:00
Émilie Feral
1108ef21db [calculation] Do not memoize the expression layouts but the expressions
final height to avoid overflowing the heap. The expression layouts are
kept in the cell which are fewer then the number of calculations
2018-05-16 18:36:45 +02:00
Émilie Feral
bb8ab2a42e Merge branch 'saisie-jolie' into master-merge-saisie-jolie 2018-05-16 11:28:07 +02:00
Émilie Feral
1d7bd2b70a [calculation] Change method name: shouldDisplayApproximateOutput --> shouldOnlyDisplayApproximateOutput 2018-05-15 11:33:28 +02:00
Émilie Feral
b84972da6a [apps] Calculation: Memoization of the equal sign type (approximate or
equal) in the model
2018-05-15 11:33:28 +02:00
Léa Saviot
c4b5d4cf40 Merge branch 'SaisieJolieRebase1201' into SaisieJolieMerge10Apr
Change-Id: I802dbb9f7c0eebf75a1b6cd21ddd194e89b53752
2018-04-10 17:21:54 +02:00
Émilie Feral
f2db9f2065 [apps] Calculation: exact and approximate output can be equal even if
the exact output is not a rational: 1/2+i = 0.5+i
2018-01-30 19:14:42 +01:00
Émilie Feral
03c8b373f7 [apps] Calculation: update the equal sign view according to the
calculation outputs
2018-01-30 19:14:42 +01:00
Émilie Feral
17fc7998a2 [apps] Calculation: Ans is exact only when the expression hold is exact 2018-01-16 15:17:16 +01:00