diff --git a/apps/probability/law/law_controller.cpp b/apps/probability/law/law_controller.cpp index f6656b86d..3e1f76b1b 100644 --- a/apps/probability/law/law_controller.cpp +++ b/apps/probability/law/law_controller.cpp @@ -63,8 +63,7 @@ int Probability::LawController::reusableCellCount() { void Probability::LawController::willDisplayCellForIndex(TableViewCell * cell, int index) { MenuListCell * myCell = (MenuListCell *)cell; - myCell->textView()->setText(m_messages[index]); - myCell->textView()->setAlignment(0., 0.5); + myCell->setText(m_messages[index]); } KDCoordinate Probability::LawController::cellHeight() { diff --git a/escher/include/escher/menu_list_cell.h b/escher/include/escher/menu_list_cell.h index e0df272c4..b98e289fd 100644 --- a/escher/include/escher/menu_list_cell.h +++ b/escher/include/escher/menu_list_cell.h @@ -10,8 +10,8 @@ class MenuListCell : public TableViewCell { public: MenuListCell(char * label = nullptr); - PointerTextView * textView(); virtual View * contentView() const; + void setText(const char * text); void drawRect(KDContext * ctx, KDRect rect) const override; void reloadCell() override; int numberOfSubviews() const override; diff --git a/escher/src/menu_list_cell.cpp b/escher/src/menu_list_cell.cpp index e2b9c22ef..d76236d95 100644 --- a/escher/src/menu_list_cell.cpp +++ b/escher/src/menu_list_cell.cpp @@ -41,8 +41,9 @@ void MenuListCell::reloadCell() { m_pointerTextView.setBackgroundColor(backgroundColor); } -PointerTextView * MenuListCell::textView() { - return &m_pointerTextView; +void MenuListCell::setText(const char * text) { + m_pointerTextView.setText(text); + layoutSubviews(); } View * MenuListCell::contentView() const {