[apps/graph] CurveParameterController: reload data when view appears

rather than set null frame when disappearing in order to reload model
This commit is contained in:
Émilie Feral
2019-09-06 17:31:38 +02:00
parent 236b4b77af
commit fdaec27ad9
2 changed files with 3 additions and 6 deletions

View File

@@ -76,11 +76,8 @@ int CurveParameterController::reusableCellCount() {
return 1 + (shouldDisplayCalculationAndDerivative() ? 2 : 0);
}
void CurveParameterController::viewDidDisappear() {
/* Deselect the table properly because it needs to be relayouted the next time
* it appears: the number of rows might change according to the plot type. */
m_selectableTableView.deselectTable(false);
m_selectableTableView.setFrame(KDRectZero);
void CurveParameterController::viewWillAppear() {
m_selectableTableView.reloadData();
}
bool CurveParameterController::shouldDisplayCalculationAndDerivative() const {

View File

@@ -18,7 +18,7 @@ public:
HighlightCell * reusableCell(int index) override;
int reusableCellCount() override;
void willDisplayCellForIndex(HighlightCell * cell, int index) override;
void viewDidDisappear() override;
void viewWillAppear() override;
private:
bool shouldDisplayCalculationAndDerivative() const;
int cellIndex(int visibleCellIndex) const;