[escher] Re layout subviews of menu list view when changing the text of

the cell

Change-Id: I9d21ffbc7967687f8701f0258501148b5b39fdc0
This commit is contained in:
Émilie Feral
2016-11-07 13:36:01 +01:00
parent 46638f8ffc
commit 199ff9e63d
3 changed files with 5 additions and 5 deletions

View File

@@ -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() {

View File

@@ -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;

View File

@@ -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 {