From 2a207e59ac25b39ca9a23512e456e7d9ea6bbc18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 30 Jan 2018 14:12:28 +0100 Subject: [PATCH] [apps] Probability: fix scrolling in calculation cells --- apps/probability/calculation_controller.cpp | 2 ++ escher/include/escher/text_field.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/probability/calculation_controller.cpp b/apps/probability/calculation_controller.cpp index d2b3835ba..a80e101f6 100644 --- a/apps/probability/calculation_controller.cpp +++ b/apps/probability/calculation_controller.cpp @@ -211,6 +211,8 @@ bool CalculationController::textFieldDidHandleEvent(::TextField * textField, Ion * the first responder. */ bool shouldUpdateFirstResponder = app()->firstResponder() == textField; m_selectableTableView.reloadData(shouldUpdateFirstResponder); + // The textField frame might have increased which forces to reload the textField scroll + textField->scrollToCursor(); } return returnValue; } diff --git a/escher/include/escher/text_field.h b/escher/include/escher/text_field.h index 95291197e..b69ab9529 100644 --- a/escher/include/escher/text_field.h +++ b/escher/include/escher/text_field.h @@ -35,6 +35,7 @@ public: constexpr static int maxBufferSize() { return ContentView::k_maxBufferSize; } + void scrollToCursor(); protected: class ContentView : public View { public: @@ -95,7 +96,6 @@ private: bool privateHandleEvent(Ion::Events::Event event); void deleteCharPrecedingCursor(); bool deleteEndOfLine(); - void scrollToCursor(); bool m_hasTwoBuffers; TextFieldDelegate * m_delegate; };