Commit Graph

628 Commits

Author SHA1 Message Date
Léa Saviot
2061c5d692 [escher/text_area] Fix text indentation handling
We used a small buffer to preprocess a text to insert in text area (add
indentation, remove empty code points, compute the next cursor location),
but the size of this buffer was sometimes too small and caused a crash.
Now we do all the text odification in place in the text area buffer.
2019-06-13 11:40:13 -04:00
Léa Saviot
3d991e56da [escher/poincare] Cleaner way to find the cursored layout in LayoutField
Everything is now in the virtual method
LayoutNode::layoutToPointWhenInserting
This removes a dirty inclusion of apps/i18n.h in escher
2019-05-27 17:24:11 +02:00
Émilie Feral
2217eebaec [escher] SelectableTableView: when reloading data, we temporary deselect
the table. We warn the SelectableTableViewDelegate that the selection
change is 'within a temporary selection change' when notifying it of the
change.
2019-05-03 15:54:21 +02:00
Émilie Feral
5e280c7538 [escher] ExpressionView: optimize setLayouts to avoid marking the whole
view as dirty when the layout did not really changed
2019-05-03 15:54:21 +02:00
Émilie Feral
c1a0e94ec7 [escher] Clean empty lines 2019-05-03 15:54:21 +02:00
Émilie Feral
240ed439e0 [escher] ScrollableView: discard duplicate data source of scrolling
offset
2019-05-03 15:54:21 +02:00
Émilie Feral
50ad6b6761 [escher] SelectableTableViewDataSource: avoid calling m_delegate->tableViewDidChangeSelection when only reloading the data. 2019-05-03 15:54:20 +02:00
Ruben Dashyan
a3fe99da21 [escher] Simplify TableView::scrollToCell 2019-05-03 15:54:20 +02:00
Léa Saviot
a88a1bcbef [escher] Increase TextField::maxBufferSize
In order to be able to write a 10*10 adjacency matrix
2019-05-03 15:53:21 +02:00
Léa Saviot
b3d0de564a [coding style] Small inlining 2019-05-03 15:53:20 +02:00
Léa Saviot
3f0bdc6630 [escher] Fix TextArea::handleEventWithText
It did not handle properly a new line (placed the cursor wrongly).
2019-05-03 15:53:20 +02:00
Léa Saviot
b2a97cfc7a [escher] Fix buffer choice in TextField::glyphFrameAtPosition 2019-05-03 15:53:20 +02:00
Léa Saviot
7f4ef39d0c [text_area] Fix Text::Position use with unicode
A glyph offset is not equivalent to a code point offset since a code
point can be several glyphs long.
2019-05-03 15:53:19 +02:00
Léa Saviot
f9fbcabb30 [escher/ion] Factorize code for removing a code point in text field/area 2019-05-03 15:53:19 +02:00
Léa Saviot
9e06b23bbb [escher/ion] Standard methods in UTF8Helper used in text_area
String manipulations need to be done using an UTF8 decoder, but some
manipulations can be optimized if the code points we manipulate are only
one char long. These optimizations are done inside UTF8Helper methods.
2019-05-03 15:53:19 +02:00
Léa Saviot
bd2ea41fbe [apps/escher] Rename cursorTextLocation as cursorLocation 2019-05-03 15:53:19 +02:00
Léa Saviot
cfbb1318ad [escher] Clean TextView 2019-05-03 15:53:19 +02:00
Léa Saviot
7b5c51b3c3 [escher] Fix textfield edition 2019-05-03 15:53:19 +02:00
Léa Saviot
bbb10f1993 [ion/kandinsky] Move unicode to ion 2019-05-03 15:53:19 +02:00
Léa Saviot
f0e8196016 [escher] Fix text field and text area navigation 2019-05-03 15:53:19 +02:00
Léa Saviot
5c39cab73e [escher] Fix text inputs so they use UTF8 2019-05-03 15:53:19 +02:00
Léa Saviot
07a910b455 [escher] Clean text_input 2019-05-03 15:53:19 +02:00
Léa Saviot
65e5adafac Remove Ion::Charset 2019-05-03 15:53:19 +02:00
Ruben Dashyan
b5dc7f738e [escher/table_view] scrollToCell includes CellOverlap
In passing, factorize duplicate code.
2019-02-18 16:49:58 +01:00
Ruben Dashyan
9ea63678e1 [escher] Inline ScrollView::setCommonMargins 2019-02-18 16:49:58 +01: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
571967088e [escher/scroll_view] Uniformize scroll bars frame across Epsilon 2019-02-18 16:49:58 +01:00
Ruben Dashyan
15de9f93ef [escher/scroll_view] Implement Decorator::indicatorAtIndex explicitly
Instead of using pointer arithmetic
2019-02-18 16:49:58 +01:00
Émilie Feral
3487547f16 [escher] ScrollView: fix Decorators contructor/destructors 2019-02-18 16:49:58 +01:00
Émilie Feral
f18a55defe [escher] ScrollView: make numberOfIndicators method const 2019-02-18 16:49:58 +01:00
Ruben Dashyan
1662b06f36 [escher/scroll_view] Put the decorators inside a union 2019-02-18 16:49:58 +01:00
Ruben Dashyan
76537cd432 [escher/scroll_view] layoutSubviews without screen tearing due to indicators 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
08e8bf0eeb [escher] Implement ScrollView::minimalSizeForOptimalDisplay including margins
Remove from derived classes:
 - apps/calculation/scrollable_expression_view
 - apps/code/consol_line_cell
 - apps/shared/scrollable_exact_approximate_expressions_view
 - escher/layout_field
 - escher/table_view
 - escher/text_field
2019-02-18 16:49:58 +01:00
Ruben Dashyan
fb32d9385e [escher/scroll_view] Encapsulate m_contentView inside m_innerView 2019-02-18 16:49:58 +01:00
Ruben Dashyan
fd654d1c79 [escher/scroll_view] Remove setColorsBackground
Introduced in commit 37da7b95a to avoid screen tearing.
Not necessary anymore since commit 0e9092d2e.
2019-02-18 16:49:58 +01:00
Ruben Dashyan
cda88b3c3b [escher/scroll_view] Fix virtuality issues of layoutSubviews
Method contentSize() made virtual and overridden by ScrollableView
so that ScrollableView and TableView do not need to setSize themselves
and that setSize/setFrame is not called twice over m_contentView.
2019-02-18 16:49:58 +01:00
Ruben Dashyan
c439d6f376 [escher/scroll_view] Mark maxContent...DisplayableWithoutScrolling() as const 2019-02-18 16:49:58 +01:00
Ruben Dashyan
acecb92f75 [escher/*_view_controller] New ViewController::initView() method
Does some part of viewWillAppear().
2019-02-18 16:49:58 +01:00
Ruben Dashyan
faae55eb51 [escher/scroll_view] Replace setShowsIndicators by setDecoratorType 2019-02-18 16:49:58 +01:00
Ruben Dashyan
09e08b43a0 [escher/scroll_view] Define enum class Decorator::Type 2019-02-18 16:49:58 +01:00
Ruben Dashyan
eb17334050 [escher/scroll_view] New Arrow/BarDecorator inherit from Decorator 2019-02-18 16:49:58 +01:00
Ruben Dashyan
1beb8ca98f [escher/scroll_view] Add arrow indicators 2019-02-18 16:49:58 +01:00
Ruben Dashyan
1e958717fb [escher/scroll_view] Rename m_indicatorThickness to m_barsFrameBreadth 2019-02-18 16:49:58 +01:00
Ruben Dashyan
81f80ef602 [escher/scroll_view] Simplify layoutIndicators
Mark indicators' frame as dirty when necessary, indirectly by setFrame
to empty.
2019-02-18 16:49:58 +01:00
Ruben Dashyan
5b78d65b6d [escher/scroll_view] Simplify subviews management 2019-02-18 16:49:58 +01:00
Ruben Dashyan
42d6ec66ab [escher/scroll_view] Prepare ScrollViewIndicator for future ScrollViewArrow 2019-02-18 16:49:58 +01:00
Ruben Dashyan
c02d44988b [escher/scroll_view] New ScrollView::Decorator class
Containing the members specific to indicators
2019-02-18 16:49:58 +01:00
Ruben Dashyan
4936a3e7fe [escher] New ScrollViewHorizontalIndicator and ScrollViewVerticalIndicator 2019-02-18 16:49:58 +01:00
Ruben Dashyan
7114fbc8dc [escher] Simplify ScrollViewIndicator 2019-02-18 16:49:58 +01:00