Commit Graph

104 Commits

Author SHA1 Message Date
Gabriel Ozouf
de681705e6 [escher/expression_field] Renamed dumpLayout
Changed dumpLayout's name to moveCursorAndDumpContent, as the name
suggested the method was only usable on layouts (while it also works on
text). The method is also no longer marked const, and the previous name
could imply that it had no side effects.
Likewise, renamed restoreLayout to restoreContent.

Change-Id: I46b320e74c07b48e256dc2146f9ecc15af38a8e6
2020-11-04 15:07:19 +01:00
Gabriel Ozouf
e295516928 [apps/calculation] Remember input layout
When leaving the Calculation app, the layout currently being edited is
now stored in a buffer, to be restored when the app resumes.

Change-Id: I59c16e18f7193bdcbb36888b54cb2722897f85f5
2020-11-04 14:45:35 +01:00
Gabriel Ozouf
0927ffca29 [apps/calculation] Moved input buffer to snapshot
The cacheBuffer from EditExpressionController has been moved in the
snapshot, to act as a zone where layout information can be kept while
the app is inactive.

Change-Id: If9206abf77f37d6b984826e5f09658848381a75f
2020-11-04 14:45:35 +01:00
Émilie Feral
df74c2c551 [apps/calculation] The heights (common and expanded) of calculation cells are
computed when the calculation is added to the store and don't change afterwards.
Otherwise, if their heights change when scrolling (due to a modification of the
display output type - ExactOnly, ApproximateOnly...), it generates crashes.
2020-07-16 14:37:38 +02:00
Émilie Feral
457fa6a925 [apps/calculation] When EditExpressionController becomes the first
responder, scroll to the bottom of the table (and not the last cell).
Indeed, the last cell might be to big to be displayed and scroll to it
might scroll to its top.

This fixes the following bug: input 1/2/3/4/5/6/7/8, OK, up, down. We
did not scroll to the bottom of the table.
2020-06-26 17:48:31 +02:00
Ruben Dashyan
167827f0e4 [apps/calculation] EditExpressionController accesses subview directly 2020-06-04 14:50:01 +02:00
Ruben Dashyan
63ab8710b9 [apps/calculation] Factor EditExpressionController::insertTextBody 2020-06-04 14:50:01 +02:00
Romain Goyet
1353e512fe [apps] Remove dead code 2020-02-17 10:31:24 -05:00
Romain Goyet
a187f39094 [apps] Report telemetry events 2020-02-17 10:31:24 -05:00
Léa Saviot
756eeeb2d8 [poincare/parser] Add context 2020-02-12 15:13:21 +01:00
Émilie Feral
47e4abee81 [apps/calculation] Reload display output when HistoryController appears
(to avoid displaying 2 = 2 when leaving and reentering Calculation app)
2020-02-12 15:13:18 +01:00
Ruben Dashyan
5787d50a45 Revert "[apps/calculation/edit_expression_controller] Define viewWillAppear"
This reverts commit 960736203ff2f816688868e3397d178d931fa3c3.
2020-02-12 15:13:16 +01:00
Ruben Dashyan
7fce83d1dd [escher/expression_field] Detect whether view's height did change by memoizing the height
Such changes used to be detected only when the height was equal to the
maximal allowed value, by detecting whether the height shifted from or
to that maximal value. For that purpose, a boolean was memoized in
InputViewController and in Calculation::EditExpressionController.
2020-02-12 15:13:16 +01:00
Ruben Dashyan
b832a9e9f4 [apps/calculation/edit_expression_controller] Define viewWillAppear 2020-02-12 15:13:16 +01:00
Ruben Dashyan
b624e47ccb [apps/calculation/edit_expression_controller] Remove dummy viewDidDisappear
HistoryController does not override ViewController's default
viewDidDisappear.
2020-02-12 15:13:15 +01:00
Ruben Dashyan
7a49e23e3b [apps/calculation] Factor HistoryController::reload 2020-02-12 15:13:15 +01:00
Léa Saviot
0630ae55c7 [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.
2020-02-12 15:13:15 +01:00
Léa Saviot
9f018eb9d9 [escher/view] setFrame and layoutSubviews can be forced 2020-02-12 15:13:15 +01:00
Ruben Dashyan
491a93d8f1 [apps/calculation/edit_expression_controller] Access view more directly 2020-02-12 15:13:15 +01:00
Ruben Dashyan
59e6c9d324 [apps/calculation/edit_expression_controller] view() does not return nullptr 2020-02-12 15:13:15 +01:00
Ruben Dashyan
227c9a8d68 [apps/calculation/edit_expression_controller] Inline view() in header 2020-02-12 15:13:15 +01:00
Émilie Feral
12060e2ae7 [escher] TextField: all text fields use the same draft text buffer 2019-08-13 09:44:00 +02:00
Léa Saviot
a7d3df39c3 Typo 2019-08-08 17:22:03 +02:00
Ruben Dashyan
44809f4b3f Substitute Escher app() by Container::activeApp() 2019-07-19 15:06:25 +02:00
Ruben Dashyan
1a2a651f36 [apps] Replace app() by expressionFieldDelegateApp() in Calculation::EditExpressionController 2019-07-19 15:06:25 +02:00
Ruben Dashyan
3e992a3560 [apps] Replace app() by textFieldDelegateApp() in TextFieldDelegates 2019-07-19 15:06:25 +02:00
Ruben Dashyan
9611133276 [apps] Factor Shared::TextFieldDelegateApp::isAcceptableText 2019-07-19 15:06:25 +02:00
Ruben Dashyan
055d601854 [apps] Define TextFieldDelegate::textFieldDelegateApp() directly from ::app() 2019-07-19 15:06:25 +02:00
Ruben Dashyan
5058f64163 [apps] Define LayoutFieldDelegate::expressionFieldDelegateApp() directly from ::app() 2019-07-19 15:06:25 +02:00
Ruben Dashyan
4111927bae [apps] Access *DelegateApp() through app() 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
Ruben Dashyan
62cec10b46 [apps] Clean unnecessary AppsContainer class declarations and header inclusions 2019-07-19 15:06:25 +02:00
Léa Saviot
94603b2b7d [poincare] Layout::serialize is serializeForParsing or ParsedExpression
serializeForParsing serializes the layout once,
serializeParsedExpression serializes the layout, parses it and
serializes it again.
2018-11-23 12:04:09 +01:00
Léa Saviot
33676e915a [apps] Check that serialized expression is not too long in Graph 2018-11-23 12:04:09 +01:00
Léa Saviot
f5586b3d36 [apps] Clean the syntax error warning displaying 2018-11-23 12:04:09 +01:00
Léa Saviot
f6804c2d67 [apps] Use ExpressionFieldDelegateApp methods in Calculation::App
For methods textFieldDidReceiveEvent and layoutFieldDidReceiveEvent
2018-11-23 12:04:08 +01:00
Émilie Feral
7e7c77a0e8 [escher] TextField and LayoutField handle move events while in editing
mode to avoid leaving unexpectedly edition mode
2018-11-23 12:04:03 +01:00
Émilie Feral
698332c355 [escher] InputTextDelegate and LayoutFieldDelegate don't inherit from
InputTextDelegate to avoid diamond inheritance
2018-11-23 12:04:03 +01:00
Émilie Feral
a93e9566ad [escher] Create a parent class Field of TextField and
LayoutField
2018-11-23 12:03:59 +01:00
Léa Saviot
6b8d8a1e55 [escher] Prevent superfluous layout clearings 2018-09-20 16:46: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
Léa Saviot
985f310b1c [escher] Just replace the layout when clearing it in LayoutField 2018-09-14 11:28:37 +02:00
Émilie Feral
0fbab2f35c [apps] Get rid of DynamicViewController 2018-09-07 17:55:42 +02:00
Léa Saviot
71c807b565 [poincare] Node->isDefined becomes !Node->isUninitialized 2018-08-14 16:40:12 +02:00
Émilie Feral
aaa20a58fa [poincare] Implement SerializationHelper and
SerializationHelperInterface. WriteTextInBuffer->serialize
2018-08-08 15:31:40 +02:00
Léa Saviot
a0c427076f [apps/claculation] Remove duplicate layout reference 2018-07-05 11:08:36 +02:00
Léa Saviot
880c3e59de [poincare] Continue removing layouts 2018-07-03 18:29:08 +02:00
Émilie Feral
5dcfbf83e9 [escher] ExpressionLayoutFieldDelegate should not take a text as
parameter but a layout
Warning: in ExpressionField: the serialized layout is not guaranteed to
be small enough to fill in the text buffer
2018-05-17 13:53:10 +02:00
Léa Saviot
3953ca1c67 [escher] Remove duplicate method
Change-Id: Iac03f002cb6928831a8d640f1bcdeba116f71d06
2018-05-17 13:42:20 +02:00