[apps/sequence/list] Correct selection navigation

Change-Id: I1d4ec884bae977e284affcfbc00f89379f53dd0b
This commit is contained in:
Émilie Feral
2017-02-08 16:19:04 +01:00
parent b796098e8f
commit 81b0f58fd8

View File

@@ -67,12 +67,20 @@ bool ListController::handleEvent(Ion::Events::Event event) {
void ListController::tableViewDidChangeSelection(SelectableTableView * t, int previousSelectedCellX, int previousSelectedCellY) {
if (m_functionStore->numberOfFunctions() == m_functionStore->maxNumberOfFunctions() || t->selectedRow() < numberOfRows() - 1) {
if (t->selectedColumn() == 0) {
SequenceTitleCell * myCell = (SequenceTitleCell *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
app()->setFirstResponder(myCell);
SequenceCell * myCell = (SequenceCell *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
app()->setFirstResponder(myCell);
if (t->selectedRow() == -1) {
return;
}
if (t->selectedRow() == previousSelectedCellY) {
SequenceCell * otherCell = (SequenceCell *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY);
myCell->selectSubCell(otherCell->selectedSubCell());
} else {
SequenceExpressionCell * myCell = (SequenceExpressionCell *)t->cellAtLocation(t->selectedColumn(), t->selectedRow());
app()->setFirstResponder(myCell);
if (t->selectedRow() < previousSelectedCellY) {
myCell->selectSubCell(myCell->numberOfSubCells()-1);
} else {
myCell->selectSubCell(0);
}
}
} else {
if (app()->firstResponder() != t) {