[apps/shared] In values controller, update the number of columns when

layout is done

Change-Id: I29bc776623ff2e5056c9f2cc1d995b4440996116
This commit is contained in:
Émilie Feral
2017-06-07 10:44:14 +02:00
parent d28a9e4664
commit bf11591e3e
12 changed files with 37 additions and 44 deletions

View File

@@ -7,8 +7,8 @@ using namespace Poincare;
namespace Graph {
ValuesController::ValuesController(Responder * parentResponder, CartesianFunctionStore * functionStore, Interval * interval, uint32_t * modelVersion, ButtonRowController * header) :
Shared::ValuesController(parentResponder, header, I18n::Message::XColumn, &m_intervalParameterController, interval, modelVersion),
ValuesController::ValuesController(Responder * parentResponder, CartesianFunctionStore * functionStore, Interval * interval, ButtonRowController * header) :
Shared::ValuesController(parentResponder, header, I18n::Message::XColumn, &m_intervalParameterController, interval),
m_functionTitleCells{},
m_floatCells{},
m_functionStore(functionStore),
@@ -16,7 +16,6 @@ ValuesController::ValuesController(Responder * parentResponder, CartesianFunctio
m_intervalParameterController(this, m_interval),
m_derivativeParameterController(this)
{
updateNumberOfColumns();
}
bool ValuesController::handleEvent(Ion::Events::Event event) {
@@ -173,13 +172,13 @@ void ValuesController::unloadView(View * view) {
}
void ValuesController::updateNumberOfColumns() {
int result = 1;
for (int i = 0; i < m_functionStore->numberOfActiveFunctions(); i++) {
if (m_functionStore->activeFunctionAtIndex(i)->isActive()) {
result += 1 + m_functionStore->activeFunctionAtIndex(i)->displayDerivative();
int result = 1;
for (int i = 0; i < m_functionStore->numberOfActiveFunctions(); i++) {
if (m_functionStore->activeFunctionAtIndex(i)->isActive()) {
result += 1 + m_functionStore->activeFunctionAtIndex(i)->displayDerivative();
}
}
}
m_numberOfColumns = result;
m_numberOfColumns = result;
}
}