mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps] Fix variable box layout memoization
Reset the memoization when changing the variable box tab
This commit is contained in:
@@ -36,9 +36,8 @@ void VariableBoxController::viewDidDisappear() {
|
||||
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
|
||||
m_leafCells[i].setLayout(Layout());
|
||||
m_leafCells[i].setAccessoryLayout(Layout());
|
||||
m_layouts[i] = Layout();
|
||||
}
|
||||
m_firstMemoizedLayoutIndex = 0;
|
||||
resetMemoization();
|
||||
NestedMenuController::viewDidDisappear();
|
||||
}
|
||||
|
||||
@@ -156,8 +155,10 @@ bool VariableBoxController::selectSubMenu(int selectedRow) {
|
||||
bool VariableBoxController::returnToPreviousMenu() {
|
||||
if (isDisplayingEmptyController()) {
|
||||
pop();
|
||||
} else {
|
||||
m_selectableTableView.deselectTable();
|
||||
resetMemoization();
|
||||
}
|
||||
m_selectableTableView.deselectTable();
|
||||
m_currentPage = Page::RootMenu;
|
||||
return NestedMenuController::returnToPreviousMenu();
|
||||
}
|
||||
@@ -241,3 +242,10 @@ bool VariableBoxController::displayEmptyController() {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void VariableBoxController::resetMemoization() {
|
||||
for (int i = 0; i < k_maxNumberOfDisplayedRows; i++) {
|
||||
m_layouts[i] = Layout();
|
||||
}
|
||||
m_firstMemoizedLayoutIndex = 0;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ private:
|
||||
Ion::Storage::Record recordAtIndex(int rowIndex);
|
||||
bool displayEmptyController();
|
||||
bool isDisplayingEmptyController() { return StackViewController::depth() == 2; }
|
||||
void resetMemoization();
|
||||
Page m_currentPage;
|
||||
Page m_lockPageDelete;
|
||||
ExpressionTableCellWithExpression m_leafCells[k_maxNumberOfDisplayedRows];
|
||||
|
||||
Reference in New Issue
Block a user