[apps/graph] Fix bug: select the right cell ot table at disappearing and

only then

Change-Id: Ie9755694ae84f774ee1e3425d4bc7f1217ef6500
This commit is contained in:
Émilie Feral
2017-06-14 18:07:01 +02:00
parent d33a83ae8c
commit 010014a4b5
2 changed files with 8 additions and 3 deletions

View File

@@ -25,9 +25,6 @@ bool FunctionParameterController::handleEvent(Ion::Events::Event event) {
case 0:
{
m_cartesianFunction->setDisplayDerivative(!m_cartesianFunction->displayDerivative());
if (m_cartesianFunction->displayDerivative()) {
m_valuesController->selectCellAtLocation(m_valuesController->selectedColumn()+1, m_valuesController->selectedRow());
}
m_selectableTableView.reloadData();
return true;
}
@@ -63,6 +60,13 @@ int FunctionParameterController::reusableCellCount() {
return k_totalNumberOfCell;
}
void FunctionParameterController::viewWillAppear() {
ValuesFunctionParameterController::viewWillAppear();
if (m_cartesianFunction->displayDerivative()) {
m_valuesController->selectCellAtLocation(m_valuesController->selectedColumn()+1, m_valuesController->selectedRow());
}
}
void FunctionParameterController::willDisplayCellForIndex(HighlightCell * cell, int index) {
if (cell == &m_displayDerivativeColumn) {
SwitchView * switchView = (SwitchView *)m_displayDerivativeColumn.accessoryView();