diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index b6e2c06f4..e446eb1d6 100644 --- a/apps/calculation/history_view_cell.cpp +++ b/apps/calculation/history_view_cell.cpp @@ -54,6 +54,7 @@ void HistoryViewCell::reloadCell() { m_result.setBackgroundColor(Palette::CellBackgroundColor); m_prettyPrint.setBackgroundColor(backgroundColor); } + m_prettyPrint.reloadCell(); TableViewCell::reloadCell(); layoutSubviews(); } diff --git a/apps/calculation/pretty_print_view.cpp b/apps/calculation/pretty_print_view.cpp index 9c4bf53f5..a34e9da88 100644 --- a/apps/calculation/pretty_print_view.cpp +++ b/apps/calculation/pretty_print_view.cpp @@ -34,6 +34,10 @@ KDSize PrettyPrintView::minimalSizeForOptimalDisplay() { return m_expressionView.minimalSizeForOptimalDisplay(); } +void PrettyPrintView::reloadCell() { + setContentOffset({0, 0}); +} + bool PrettyPrintView::handleEvent(Ion::Events::Event event) { switch (event) { case Ion::Events::Event::RIGHT_ARROW: diff --git a/apps/calculation/pretty_print_view.h b/apps/calculation/pretty_print_view.h index 3230d43f5..f7d78e197 100644 --- a/apps/calculation/pretty_print_view.h +++ b/apps/calculation/pretty_print_view.h @@ -13,6 +13,7 @@ public: void setBackgroundColor(KDColor backgroundColor); bool handleEvent(Ion::Events::Event event) override; KDSize minimalSizeForOptimalDisplay() override; + void reloadCell(); private: ExpressionView m_expressionView; KDCoordinate m_manualScrolling;