mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-29 19:49:58 +02:00
Merge "[apps/graph/list] keep the function of interest selected when going forth and back to the parameter page"
This commit is contained in:
@@ -12,7 +12,6 @@ ListController::ListController(Responder * parentResponder, Graph::FunctionStore
|
||||
}
|
||||
|
||||
View * ListController::view() {
|
||||
setActiveCell(0);
|
||||
return &m_tableView;
|
||||
}
|
||||
|
||||
@@ -37,6 +36,19 @@ void ListController::setActiveCell(int index) {
|
||||
app()->setFirstResponder(cell);
|
||||
}
|
||||
|
||||
void ListController::didBecomeFirstResponder() {
|
||||
if (m_activeCell == -1) {
|
||||
setActiveCell(0);
|
||||
} else {
|
||||
if (m_activeCell < m_functionStore->numberOfFunctions()) {
|
||||
setActiveCell(m_activeCell);
|
||||
} else {
|
||||
setActiveCell(m_functionStore->numberOfFunctions()-1);
|
||||
}
|
||||
}
|
||||
assert(m_activeCell >= 0);
|
||||
}
|
||||
|
||||
void ListController::configureFunction(Graph::Function * function) {
|
||||
StackViewController * stack = ((StackViewController *)parentResponder());
|
||||
m_parameterController.setFunction(function);
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
View * view() override;
|
||||
const char * title() const override;
|
||||
bool handleEvent(Ion::Events::Event event) override;
|
||||
void didBecomeFirstResponder() override;
|
||||
|
||||
int numberOfCells() override;
|
||||
void willDisplayCellForIndex(View * cell, int index) override;
|
||||
|
||||
Reference in New Issue
Block a user