[calculation] Additional outputs: display left and center subviews of

InputExactApproximateExpressionsView in the additional output pop-up
This commit is contained in:
Émilie Feral
2019-11-21 16:42:55 +01:00
committed by Léa Saviot
parent eac83fce0b
commit c7ae89fcba
2 changed files with 7 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ IllustratedListController::IllustratedListController(Responder * parentResponder
{
for (int i = 0; i < k_maxNumberOfAdditionalCalculations; i++) {
m_additionalCalculationCells[i].setParentResponder(m_listController.selectableTableView());
m_additionalCalculationCells[i].setDisplayLeft(true);
}
}
@@ -83,8 +84,11 @@ void IllustratedListController::willDisplayCellForIndex(HighlightCell * cell, in
// TODO ?
return;
}
Poincare::Context * context = App::app()->localContext();
ScrollableInputExactApproximateExpressionsCell * myCell = (ScrollableInputExactApproximateExpressionsCell *)cell;
myCell->setCalculation(m_calculationStore.calculationAtIndex(index-1).pointer());
Calculation * c = m_calculationStore.calculationAtIndex(index-1).pointer();
myCell->setCalculation(c);
myCell->setDisplayCenter(c->displayOutput(context) != Calculation::DisplayOutput::ApproximateOnly);
//myCell->setHighlighted(myCell->isHighlighted()); //TODO??
}

View File

@@ -37,6 +37,8 @@ public:
ScrollableInputExactApproximateExpressionsCell() : m_view(nullptr) {}
void setParentResponder(Responder * r) { m_view.setParentResponder(r); }
void setCalculation(Calculation * calculation) { m_view.setCalculation(calculation); }
void setDisplayCenter(bool display) { m_view.setDisplayCenter(display); }
void setDisplayLeft(bool display) { m_view.setDisplayLeft(display); }
private:
int numberOfSubviews() const override { return 1; }
View * subviewAtIndex(int index) override { return &m_view; }