diff --git a/apps/calculation/history_controller.cpp b/apps/calculation/history_controller.cpp index 942665a8f..5a4a99554 100644 --- a/apps/calculation/history_controller.cpp +++ b/apps/calculation/history_controller.cpp @@ -180,7 +180,7 @@ int HistoryController::reusableCellCount(int type) { void HistoryController::willDisplayCellForIndex(HighlightCell * cell, int index) { HistoryViewCell * myCell = (HistoryViewCell *)cell; - myCell->setCalculation(calculationAtIndex(index).pointer()); + myCell->setCalculation(calculationAtIndex(index).pointer(), index == selectedRow() && selectedSubviewType() == SubviewType::Output); myCell->setEven(index%2 == 0); myCell->setHighlighted(myCell->isHighlighted()); } diff --git a/apps/calculation/history_view_cell.cpp b/apps/calculation/history_view_cell.cpp index f623e835e..145461c40 100644 --- a/apps/calculation/history_view_cell.cpp +++ b/apps/calculation/history_view_cell.cpp @@ -144,9 +144,9 @@ void HistoryViewCell::layoutSubviews(bool force) { force); } -void HistoryViewCell::setCalculation(Calculation * calculation) { +void HistoryViewCell::setCalculation(Calculation * calculation, bool expanded) { uint32_t newCalculationCRC = Ion::crc32Byte((const uint8_t *)calculation, ((char *)calculation->next()) - ((char *) calculation)); - if (newCalculationCRC == m_calculationCRC32) { + if (m_calculationExpanded == expanded && newCalculationCRC == m_calculationCRC32) { return; } Poincare::Context * context = App::app()->localContext(); @@ -157,6 +157,7 @@ void HistoryViewCell::setCalculation(Calculation * calculation) { // Memoization m_calculationCRC32 = newCalculationCRC; + m_calculationExpanded = expanded; m_calculationDisplayOutput = calculation->displayOutput(context); m_calculationAdditionInformation = calculation->additionalInformationType(context); m_inputView.setLayout(calculation->createInputLayout()); diff --git a/apps/calculation/history_view_cell.h b/apps/calculation/history_view_cell.h index 531cbfb9f..42842d658 100644 --- a/apps/calculation/history_view_cell.h +++ b/apps/calculation/history_view_cell.h @@ -39,7 +39,7 @@ public: } Poincare::Layout layout() const override; KDColor backgroundColor() const override; - void setCalculation(Calculation * calculation); + void setCalculation(Calculation * calculation, bool expanded); int numberOfSubviews() const override; View * subviewAtIndex(int index) override; void layoutSubviews(bool force = false) override;