mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[regression] CalculationController: fix sub cell selection
This commit is contained in:
committed by
LeaNumworks
parent
f6edf05708
commit
1982af1613
@@ -82,11 +82,17 @@ void CalculationController::tableViewDidChangeSelection(SelectableTableView * t,
|
||||
}
|
||||
}
|
||||
if (t->selectedColumn() > 0 && t->selectedRow() >= 0 && t->selectedRow() <= k_totalNumberOfDoubleBufferRows) {
|
||||
// If we are on a double text cell, we have to choose which subcell to select
|
||||
EvenOddDoubleBufferTextCellWithSeparator * myCell = (EvenOddDoubleBufferTextCellWithSeparator *)t->selectedCell();
|
||||
// Default selected subcell is the left one
|
||||
bool firstSubCellSelected = true;
|
||||
if (previousSelectedCellX > 0 && previousSelectedCellY >= 0 && previousSelectedCellY <= k_totalNumberOfDoubleBufferRows) {
|
||||
// If we come from another double text cell, we have to update subselection
|
||||
EvenOddDoubleBufferTextCellWithSeparator * myPreviousCell = (EvenOddDoubleBufferTextCellWithSeparator *)t->cellAtLocation(previousSelectedCellX, previousSelectedCellY);
|
||||
firstSubCellSelected = myPreviousCell->firstTextSelected();
|
||||
/* If the selection stays in the same column, we copy the subselection
|
||||
* from previous cell. Otherwise, the selection has jumped to another
|
||||
* column, we thus subselect the other subcell. */
|
||||
firstSubCellSelected = t->selectedColumn() == previousSelectedCellX ? myPreviousCell->firstTextSelected() : !myPreviousCell->firstTextSelected();
|
||||
}
|
||||
myCell->selectFirstText(firstSubCellSelected);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user