mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
[apps/calculation] Fix history navigation
When calculations span on two lines, better selection
This commit is contained in:
committed by
EmilieNumworks
parent
a56a73b0ba
commit
b034f8e054
@@ -169,8 +169,14 @@ void HistoryController::tableViewDidChangeSelection(SelectableTableView * t, int
|
||||
} else if (selectedRow() == -1) {
|
||||
setSelectedSubviewType(SubviewType::Input, false, previousSelectedCellX, previousSelectedCellY);
|
||||
} else {
|
||||
setSelectedSubviewType(selectedSubviewType(), false, previousSelectedCellX, previousSelectedCellY);
|
||||
HistoryViewCell * selectedCell = (HistoryViewCell *)(t->selectedCell());
|
||||
SubviewType nextSelectedSubviewType = selectedSubviewType();
|
||||
if (!selectedCell->displaysSingleLine()) {
|
||||
nextSelectedSubviewType = previousSelectedCellY < selectedRow() ? SubviewType::Input : SubviewType::Output;
|
||||
}
|
||||
setSelectedSubviewType(nextSelectedSubviewType, false, previousSelectedCellX, previousSelectedCellY);
|
||||
}
|
||||
// The selectedCell may change during setSelectedSubviewType
|
||||
HistoryViewCell * selectedCell = (HistoryViewCell *)(t->selectedCell());
|
||||
if (selectedCell == nullptr) {
|
||||
return;
|
||||
|
||||
@@ -42,6 +42,9 @@ public:
|
||||
void setHighlighted(bool highlight) override;
|
||||
void reloadSubviewHighlight();
|
||||
void setDataSource(HistoryViewCellDataSource * dataSource) { m_dataSource = dataSource; }
|
||||
bool displaysSingleLine() const {
|
||||
return m_calculationSingleLine;
|
||||
}
|
||||
Responder * responder() override {
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user