[apps] enable node navigation to decide the leaf row height

Change-Id: Ib013dd50c4d57df31e9be7813440037173415330
This commit is contained in:
Émilie Feral
2016-11-14 15:20:14 +01:00
parent 0e3804d784
commit 74ee0ec63a
7 changed files with 27 additions and 2 deletions

View File

@@ -69,6 +69,23 @@ void VariableBoxController::willDisplayCellForIndex(TableViewCell * cell, int in
}
}
KDCoordinate VariableBoxController::leafRowHeight(int index) {
// TODO: add a constant to index if the node == matrice/liste
const char * parentNodeLabel = m_listViewController.nodeModel()->label();
const Expression * expression = m_context->scalarExpressionForIndex(index);
if (strcmp(parentNodeLabel, "Matrices") == 0) {
//expression = m_context->matrixExpressionForIndex(index);
}
if (strcmp(parentNodeLabel, "Listes") == 0) {
//expression = m_context->listExpressionForIndex(index);
}
if (expression) {
KDCoordinate expressionHeight = expression->createLayout()->size().height();
return expressionHeight;
}
return k_leafRowHeight;
}
Node * VariableBoxController::nodeModel() {
return (Node *)&variableBoxModel;
}