diff --git a/apps/shared/scrollable_exact_approximate_expressions_cell.cpp b/apps/shared/scrollable_exact_approximate_expressions_cell.cpp index 3894849dd..cfb76a462 100644 --- a/apps/shared/scrollable_exact_approximate_expressions_cell.cpp +++ b/apps/shared/scrollable_exact_approximate_expressions_cell.cpp @@ -21,10 +21,6 @@ void ScrollableExactApproximateExpressionsCell::setEven(bool even) { m_view.evenOddCell()->setEven(even); } -void ScrollableExactApproximateExpressionsCell::reloadCell() { - m_view.evenOddCell()->reloadCell(); -} - void ScrollableExactApproximateExpressionsCell::reloadScroll() { m_view.reloadScroll(); } diff --git a/apps/shared/scrollable_exact_approximate_expressions_cell.h b/apps/shared/scrollable_exact_approximate_expressions_cell.h index 3d8a8209f..fd3da4ace 100644 --- a/apps/shared/scrollable_exact_approximate_expressions_cell.h +++ b/apps/shared/scrollable_exact_approximate_expressions_cell.h @@ -17,7 +17,6 @@ public: } void setHighlighted(bool highlight) override; void setEven(bool even) override; - void reloadCell() override; void reloadScroll(); Responder * responder() override { return this; diff --git a/apps/shared/scrollable_exact_approximate_expressions_view.cpp b/apps/shared/scrollable_exact_approximate_expressions_view.cpp index ebbf41791..d878def8b 100644 --- a/apps/shared/scrollable_exact_approximate_expressions_view.cpp +++ b/apps/shared/scrollable_exact_approximate_expressions_view.cpp @@ -25,6 +25,7 @@ void ScrollableExactApproximateExpressionsView::ContentCell::setHighlighted(bool m_highlighted = highlight; m_leftExpressionView.setBackgroundColor(backgroundColor()); m_rightExpressionView.setBackgroundColor(backgroundColor()); + m_approximateSign.setBackgroundColor(backgroundColor()); if (highlight) { if (m_selectedSubviewPosition == SubviewPosition::Left) { m_leftExpressionView.setBackgroundColor(Palette::Select); @@ -34,15 +35,19 @@ void ScrollableExactApproximateExpressionsView::ContentCell::setHighlighted(bool } } -void ScrollableExactApproximateExpressionsView::ContentCell::reloadCell() { - setHighlighted(isHighlighted()); +void ScrollableExactApproximateExpressionsView::ContentCell::setEven(bool even) { + EvenOddCell::setEven(even); + m_leftExpressionView.setBackgroundColor(backgroundColor()); + m_rightExpressionView.setBackgroundColor(backgroundColor()); m_approximateSign.setBackgroundColor(backgroundColor()); +} + +void ScrollableExactApproximateExpressionsView::ContentCell::reloadTextColor() { if (numberOfSubviews() == 1) { m_rightExpressionView.setTextColor(KDColorBlack); } else { m_rightExpressionView.setTextColor(Palette::GreyVeryDark); } - layoutSubviews(); } KDSize ScrollableExactApproximateExpressionsView::ContentCell::minimalSizeForOptimalDisplay() const { @@ -117,6 +122,7 @@ void ScrollableExactApproximateExpressionsView::setLayouts(Poincare::Layout righ bool updateRightLayout = m_contentCell.rightExpressionView()->setLayout(rightLayout); bool updateLeftLayout = m_contentCell.leftExpressionView()->setLayout(leftLayout); if (updateRightLayout || updateLeftLayout) { + m_contentCell.reloadTextColor(); m_contentCell.layoutSubviews(); } } diff --git a/apps/shared/scrollable_exact_approximate_expressions_view.h b/apps/shared/scrollable_exact_approximate_expressions_view.h index 40ec3c59a..31d2afd87 100644 --- a/apps/shared/scrollable_exact_approximate_expressions_view.h +++ b/apps/shared/scrollable_exact_approximate_expressions_view.h @@ -35,7 +35,8 @@ private: ContentCell(); KDColor backgroundColor() const override; void setHighlighted(bool highlight) override; - void reloadCell() override; + void setEven(bool even) override; + void reloadTextColor(); KDSize minimalSizeForOptimalDisplay() const override; ExpressionView * rightExpressionView() { return &m_rightExpressionView; diff --git a/apps/solver/solutions_controller.cpp b/apps/solver/solutions_controller.cpp index 346e053e6..77e2138e4 100644 --- a/apps/solver/solutions_controller.cpp +++ b/apps/solver/solutions_controller.cpp @@ -203,7 +203,6 @@ void SolutionsController::willDisplayCellAtLocation(HighlightCell * cell, int i, } EvenOddCell * evenOddCell = static_cast(cell); evenOddCell->setEven(j%2 == 0); - evenOddCell->reloadCell(); } KDCoordinate SolutionsController::columnWidth(int i) {