diff --git a/apps/shared/list_controller.cpp b/apps/shared/list_controller.cpp index d4f8129f3..90dcee1d4 100644 --- a/apps/shared/list_controller.cpp +++ b/apps/shared/list_controller.cpp @@ -126,6 +126,7 @@ void ListController::willDisplayCellAtLocation(HighlightCell * cell, int i, int EvenOddCell * myCell = (EvenOddCell *)cell; myCell->setEven(j%2 == 0); myCell->setHighlighted(i == selectedColumn() && j == selectedRow()); + myCell->reloadCell(); } int ListController::numberOfButtons(ButtonRowController::Position position) const { diff --git a/apps/shared/new_function_cell.cpp b/apps/shared/new_function_cell.cpp index fe2bdac10..18387df61 100644 --- a/apps/shared/new_function_cell.cpp +++ b/apps/shared/new_function_cell.cpp @@ -9,8 +9,13 @@ NewFunctionCell::NewFunctionCell(I18n::Message text) : { } -void NewFunctionCell::reloadCell() { - EvenOddCell::reloadCell(); +void NewFunctionCell::setEven(bool even) { + EvenOddCell::setEven(even); + m_messageTextView.setBackgroundColor(backgroundColor()); +} + +void NewFunctionCell::setHighlighted(bool highlight) { + EvenOddCell::setHighlighted(highlight); m_messageTextView.setBackgroundColor(backgroundColor()); } diff --git a/apps/shared/new_function_cell.h b/apps/shared/new_function_cell.h index 06dbd6a46..7a8418b6c 100644 --- a/apps/shared/new_function_cell.h +++ b/apps/shared/new_function_cell.h @@ -8,7 +8,8 @@ namespace Shared { class NewFunctionCell : public EvenOddCell { public: NewFunctionCell(I18n::Message text); - void reloadCell() override; + void setEven(bool even) override; + void setHighlighted(bool highlight) override; int numberOfSubviews() const override; View * subviewAtIndex(int index) override; void layoutSubviews() override; diff --git a/escher/src/even_odd_cell.cpp b/escher/src/even_odd_cell.cpp index c8d90e582..3b6671f8a 100644 --- a/escher/src/even_odd_cell.cpp +++ b/escher/src/even_odd_cell.cpp @@ -8,8 +8,10 @@ EvenOddCell::EvenOddCell() : } void EvenOddCell::setEven(bool even) { + if (even != m_even) { m_even = even; reloadCell(); + } } KDColor EvenOddCell::backgroundColor() const { diff --git a/escher/src/expression_view.cpp b/escher/src/expression_view.cpp index 17a44d3f7..cc5c27a3a 100644 --- a/escher/src/expression_view.cpp +++ b/escher/src/expression_view.cpp @@ -21,13 +21,17 @@ void ExpressionView::setExpression(ExpressionLayout * expressionLayout) { } void ExpressionView::setBackgroundColor(KDColor backgroundColor) { - m_backgroundColor = backgroundColor; - markRectAsDirty(bounds()); + if (m_backgroundColor != backgroundColor) { + m_backgroundColor = backgroundColor; + markRectAsDirty(bounds()); + } } void ExpressionView::setTextColor(KDColor textColor) { - m_textColor = textColor; - markRectAsDirty(bounds()); + if (textColor != m_textColor) { + m_textColor = textColor; + markRectAsDirty(bounds()); + } } void ExpressionView::setAlignment(float horizontalAlignment, float verticalAlignment) { diff --git a/escher/src/highlight_cell.cpp b/escher/src/highlight_cell.cpp index a897e6741..c308c25c3 100644 --- a/escher/src/highlight_cell.cpp +++ b/escher/src/highlight_cell.cpp @@ -7,8 +7,10 @@ HighlightCell::HighlightCell() : } void HighlightCell::setHighlighted(bool highlight) { - m_highlighted = highlight; - reloadCell(); + if (m_highlighted != highlight) { + m_highlighted = highlight; + reloadCell(); + } } bool HighlightCell::isHighlighted() const {