[apps/shared] Divide tab table controller in 2 classes

Change-Id: I7bd9f7395c000ad69198ab123ffcfe1b661350aa
This commit is contained in:
Émilie Feral
2017-03-16 14:00:03 +01:00
parent 8daab4c57b
commit 7a54fa0ea0
11 changed files with 61 additions and 31 deletions

View File

@@ -2,10 +2,10 @@
namespace Shared {
TabTableController::TabTableController(Responder * parentResponder, KDCoordinate topMargin,
TabTableController::TabTableController(Responder * parentResponder, TableViewDataSource * dataSource, KDCoordinate topMargin,
KDCoordinate rightMargin, KDCoordinate bottomMargin, KDCoordinate leftMargin, SelectableTableViewDelegate * delegate, bool showIndicators) :
ViewController(parentResponder),
m_selectableTableView(SelectableTableView(this, this, 0, topMargin, rightMargin, bottomMargin, leftMargin,
m_selectableTableView(SelectableTableView(this, dataSource, 0, topMargin, rightMargin, bottomMargin, leftMargin,
delegate, showIndicators, true, Palette::WallScreenDark))
{
}
@@ -18,22 +18,6 @@ void TabTableController::didBecomeFirstResponder() {
app()->setFirstResponder(&m_selectableTableView);
}
KDCoordinate TabTableController::cumulatedWidthFromIndex(int i) {
return i*columnWidth(0);
}
KDCoordinate TabTableController::cumulatedHeightFromIndex(int j) {
return j*rowHeight(0);
}
int TabTableController::indexFromCumulatedWidth(KDCoordinate offsetX) {
return (offsetX-1) / columnWidth(0);
}
int TabTableController::indexFromCumulatedHeight(KDCoordinate offsetY) {
return (offsetY-1) / rowHeight(0);
}
void TabTableController::viewWillAppear() {
m_selectableTableView.reloadData();
}