ListBookController - partie 2

This commit is contained in:
Fournier Gabriel
2020-11-15 18:55:34 +01:00
parent c37b4bd1f4
commit b4e9ceed18
2 changed files with 22 additions and 3 deletions

View File

@@ -12,11 +12,13 @@ ListBookController::ListBookController(Responder * parentResponder):
ViewController(parentResponder),
m_tableView(this, this)
{
m_files[0].name= "Harry Potter 1.txt";
m_nbFiles = 1;
}
int ListBookController::numberOfRows() const
{
return 0;
return m_nbFiles;
}
KDCoordinate ListBookController::cellHeight()
@@ -26,12 +28,20 @@ KDCoordinate ListBookController::cellHeight()
HighlightCell * ListBookController::reusableCell(int index)
{
return nullptr;
return &m_cells[index];
}
int ListBookController::reusableCellCount() const
{
return 0;
return NB_CELLS;
}
void ListBookController::willDisplayCellForIndex(HighlightCell * cell, int index)
{
MessageTableCell* myTextCell = static_cast<MessageTableCell*>(cell);
MessageTextView* textView = static_cast<MessageTextView*>(myTextCell->labelView());
textView->setText(m_files[index].name);
myTextCell->setMessageFont(KDFont::LargeFont);
}
}